home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / FileMover / Dopus5 / DC-OP55B.LZX / Opus5 / arexx / CDO.dopus5 < prev    next >
Encoding:
Text File  |  1996-05-02  |  1.6 KB  |  46 lines

  1. /* CDO for Directory Opus 5 by Leo 'Nudel' Davidson
  2.    by Leo 'Nudel' Davidson for Gods'Gift Utilities
  3.    email: leo.davidson@keble.oxford.ac.uk  www: http://users.ox.ac.uk/~kebl0364
  4.  
  5. $VER: CDO.dopus5 1.3 (18.8.95)
  6.  
  7.    Note: Please don't confuse this with the OCD script!
  8.    Note: "CDOpus" is an assembler version of this script, with extra features.
  9.  
  10.    When run from a Shell, will echo the path used by the SOURCE Lister.
  11.    Using an alias, this can be used as a command which CD's to the path
  12.    used by the SOURCE lister.
  13.  
  14.    To set up the command "CDO", add the following to your s:shell-startup:
  15. -------------------------------------------------------------------------------
  16. Alias CDO "CD *"*`rx DOpus5:ARexx/cdo.dopus5*`*""
  17. -------------------------------------------------------------------------------
  18.  
  19.    v1.01 -> v1.02 - Now makes sure there is a source lister. (Ahem)
  20.                     Now makes sure the DOPUS.1 port exists. (Double-Ahem)
  21.     v1.02 -> v1.3 - Now uses Show() instead of ShowList(). (Thanks Stoebi)
  22.                     Style Guide compliant version numbering and $VER string.
  23. */
  24.  
  25. options results
  26. options FAILAT 99
  27. signal on syntax;signal on ioerr
  28.  
  29. If Show("P","DOPUS.1") Then
  30.     address "DOPUS.1"        /* Assumes there's only one copy. */
  31. Else
  32.     Exit                /* If no DOPUS.1 port, exit */
  33.  
  34. lister query source stem source_handle.    /* Get handle of SOURCE lister(s). */
  35.  
  36. IF source_handle.count = 0 | source_handle.count = "SOURCE_HANDLE.COUNT" Then Do
  37.     dopus front
  38.     dopus request '"You must have a SOURCE lister!" OK'
  39.     EXIT
  40.     End
  41.  
  42. Lister Query source_handle.0 Path    /* Get its path. */
  43. Say Strip(RESULT,B,'"')            /* Echo result -> input of CD cmd. */
  44. Syntax:;IoErr:
  45. EXIT
  46.