home *** CD-ROM | disk | FTP | other *** search
- /* DirToDest for Directory Opus 5.5
- by Leo 'Nudel' Davidson for Gods'Gift Utilities
- email: leo.davidson@keble.oxford.ac.uk www: http://users.ox.ac.uk/~kebl0364
-
- $VER: DirToDest.dopus5 1.5 (13.6.96)
-
- NOTE: DOpusFuncs is an assembler version of this (and other) scripts.
-
- The scrips changes the destination lister's path to the first selected
- directory in the source lister. Under Opus 5.5 you can now set up
- "ScanDir" on a Directory Filetype so you don't really need this script
- anymore, apart from as an example of the ARexx port. :)
-
- Call as:
- ------------------------------------------------------------------------------
- ARexx DOpus5:ARexx/DirToDest.dopus5 {Qp}
- ------------------------------------------------------------------------------
- Turn off all switches.
- */
-
- options results
- options failat 99
- signal on syntax;signal on ioerr /* Error trapping */
- parse arg DOpusPort
- DOpusPort = Strip(DOpusPort,"B",'" ')
-
- If DOpusPort="" THEN Do
- Say "Not correctly called from Directory Opus 5!"
- Say "Load this ARexx script into an editor for more info."
- EXIT
- END
- If ~Show("P",DOpusPort) Then Do
- Say DOpusPort "is not a valid port."
- EXIT
- End
- Address value DOpusPort
-
- dopus version
- If ( result='RESULT' | translate(result,'.',' ') < 5.1218 ) then do
- dopus request '"This script requires DOpus v5.5 or greater." OK'
- EXIT
- end
-
- lister query source stem source_handle.
-
- IF source_handle.count = 0 Then Do
- dopus request '"You must have a source lister" OK'
- EXIT
- End
-
-
- lister query dest stem dest_handle.
-
- IF dest_handle.count = 0 Then Do
- dopus request '"You must have a destination lister" OK'
- EXIT
- End
-
-
- lister query source_handle.0 path
- source_path = RESULT
- lister query source_handle.0 seldirs stem source_dir.
-
- IF source_dir.count = 0 Then Do
- lister request source_handle.0 '"You must have a directory selected" OK'
- EXIT
- End
-
- lister read dest_handle.0 source_path||source_dir.0
-
- lister select source_handle.0 source_dir.0 0
- lister refresh source_handle.0
-
- syntax:;ioerr: /* In case of error, jump here */
- EXIT
-