home *** CD-ROM | disk | FTP | other *** search
- /* $VER: CutNPaste.dopus5 1.1 (30.10.97) */
-
- /* Cut & Paste module - Adds "Cut" and "Copy" */
- /* to file pop-up menus and "Paste" to lister */
- /* pop-up menus. Nothing is done until you */
- /* Paste when the appropriate Copy or Move */
- /* command is issued. Andrew Dunbar Oct 1997 */
-
- parse arg portname function source dest arguments
- address value portname
- options results
-
- if function = 'init' then do
- cnptypes = 'type drawer type tool type project type trash type leftout'
- dopus command 'Clip-Copy' program 'CutNPaste' ext 'Copy' private cnptypes
- dopus command 'Clip-Cut' program 'CutNPaste' ext 'Cut' private cnptypes
- dopus command 'Clip-Paste' program 'CutNPaste' ext 'Paste' private type lister
- end
- else if function = 'Clip-Cut' then address command 'echo >T:clipcnp cut'arguments
- else if function = 'Clip-Copy' then address command 'echo >T:clipcnp copy'arguments
- else if function = 'Clip-Paste' then do
- lister query source path
- pastepath = result
- if open('cnpfile','T:clipcnp','r') then do
- cnpinfo = readln('cnpfile')
- call close('cnpfile')
- parse var cnpinfo cmd srcfile
- srcfile = trim(srcfile)
- if srcfile ~= '' then do
- if cmd = 'copy' then command copy 'name='srcfile 'to='pastepath
- else if cmd = 'cut' then command move 'name='srcfile 'to='pastepath
- lister wait source
- lister read source pastepath force
- end
- else dopus request '''Paste: Clipboard invalid'''
- end
- else dopus request '''Paste: Nothing in clipboard'''
- end
-