home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / FileMover / HF-OM3.DMS / in.adf / ARexx.lha / ARexx / MultiViewAppIcon.dopus5 < prev    next >
Encoding:
Text File  |  1996-07-19  |  2.0 KB  |  71 lines

  1. /*
  2.   $VER: MultiViewAppIcon.dopus5 1.0 (19.7.96)
  3.   Written by Edmund Vermeulen (edmundv@grafix.xs4all.nl).
  4.  
  5.   ARexx script for Directory Opus 5.5 to create an AppIcon for MultiView.
  6.   All files dropped on the AppIcon will be displayed with MultiView on the
  7.   Opus screen.
  8.  
  9.   Function : ARexx      DOpus5:ARexx/MultiViewAppIcon.dopus5 {Qp} {Qs}
  10. */
  11.  
  12. parse arg portname screenname .
  13. if portname='' then
  14.    portname='DOPUS.1'
  15. address value portname
  16. if screenname~='' & screenname~='SCREEN' then
  17.    screenname='PUBSCREEN' screenname
  18.  
  19. options results
  20. lf='0a'x
  21.  
  22. if ~show('l','rexxsupport.library') then
  23.    call addlib('rexxsupport.library',0,-30)
  24.  
  25. handlername='MultiViewAppIcon.'portname
  26. if show('p',handlername) then do
  27.    dopus request '"MultiView AppIcon'lf'is already running!" OK'
  28.    exit
  29.    end
  30. call openport(handlername)
  31.  
  32. dopus addappicon handlername 'MultiView 1' icon 'SYS:Utilities/MultiView' close local info quotes
  33. myicon=result
  34.  
  35. do until event='close' | event='removed'
  36.    if waitpkt(handlername) then do
  37.  
  38.       packet=getpkt(handlername)
  39.       if packet~='00000000'x then do
  40.  
  41.          event=getarg(packet,0)
  42.          id=getarg(packet,1)
  43.          namestr=getarg(packet,2)
  44.          handle=getarg(packet,3)
  45.  
  46.          select
  47.             when event='dropfrom' then
  48.                do while namestr~==''
  49.                   parse var namestr '"' thisfile '"' namestr
  50.                   if handle>0 then do
  51.                      lister query handle path
  52.                      thisfile=result||thisfile
  53.                      end
  54.                   address command 'Run >NIL: <NIL: MultiView' screenname thisfile
  55.                   end
  56.             when event='doubleclick' then
  57.                address command 'Run >NIL: <NIL: MultiView' screenname
  58.             when event='info' then
  59.                dopus request '"MultiView AppIcon'lf'Drop files on it to view them." OK'
  60.             otherwise
  61.                nop
  62.             end
  63.  
  64.          call reply(packet,0)
  65.          end
  66.       end
  67.    end
  68.  
  69. dopus remappicon myicon
  70. call closeport(handlername)
  71.