home *** CD-ROM | disk | FTP | other *** search
/ The Best of Mecomp Multimedia 2 / MECOMP-CD-II.iso / amiga / tools / opus / opus-5.x / cutnpaste / opus5 / modules / cutnpaste.dopus5
Encoding:
Text File  |  1997-10-30  |  1.5 KB  |  39 lines

  1. /* $VER: CutNPaste.dopus5 1.1 (30.10.97) */
  2.  
  3. /* Cut & Paste module - Adds "Cut" and "Copy" */
  4. /* to file pop-up menus and "Paste" to lister */
  5. /* pop-up menus.  Nothing is done until you   */
  6. /* Paste when the appropriate Copy or Move    */
  7. /* command is issued.  Andrew Dunbar Oct 1997 */
  8.  
  9. parse arg portname function source dest arguments
  10. address value portname
  11. options results
  12.  
  13. if function = 'init' then do
  14.   cnptypes = 'type drawer type tool type project type trash type leftout'
  15.   dopus command 'Clip-Copy' program 'CutNPaste' ext 'Copy' private cnptypes
  16.   dopus command 'Clip-Cut' program 'CutNPaste' ext 'Cut' private cnptypes
  17.   dopus command 'Clip-Paste' program 'CutNPaste' ext 'Paste' private type lister
  18. end
  19. else if function = 'Clip-Cut' then address command 'echo >T:clipcnp cut'arguments
  20. else if function = 'Clip-Copy' then address command 'echo >T:clipcnp copy'arguments
  21. else if function = 'Clip-Paste' then do
  22.   lister query source path
  23.   pastepath = result
  24.   if open('cnpfile','T:clipcnp','r') then do
  25.     cnpinfo = readln('cnpfile')
  26.     call close('cnpfile')
  27.     parse var cnpinfo cmd srcfile
  28.     srcfile = trim(srcfile)
  29.     if srcfile ~= '' then do
  30.       if cmd = 'copy' then command copy 'name='srcfile 'to='pastepath
  31.         else if cmd = 'cut' then command move 'name='srcfile 'to='pastepath
  32.       lister wait source
  33.       lister read source pastepath force
  34.     end
  35.     else dopus request '''Paste: Clipboard invalid'''
  36.   end
  37.   else dopus request '''Paste: Nothing in clipboard'''
  38. end
  39.