home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 532.lha / Script_v1.1 / Script.doc.pp / Script.doc
Text File  |  1991-07-10  |  7KB  |  154 lines

  1.  
  2. SCRIPT:  Version 1.1 By Richard Rogers    Copyright January 1991
  3.  
  4. What is SCRIPT: ?
  5.  
  6.      SCRIPT: is an AmigaDOS device driver (like AUX: CON: SPEAK:) that allows
  7. you to save all the input and output of a device to a file similar to the UNIX
  8. command 'script.'  But SCRIPT: can do a few other neat tricks, which I'll get
  9. to in a moment.  SCRIPT: will work with any AmigaDOS device, and can be used
  10. with both WorkBench (programs must have a WINDOW tool type) and the CLI/Shell.
  11. Requires WorkBench 1.2 version 33.43 or later.
  12.  
  13. How to install:
  14.  
  15.      Copy the file Script-Handler to the l: directory on your boot-disk.  Next,
  16. add the following lines to the boot-disk's devs:mountlist file using any plain-
  17. text (ASCII) text editor, such as ED:
  18.  
  19.      SCRIPT:
  20.         Handler = l:Script-Handler
  21.         Stacksize = 5000
  22.         Priority = 5
  23.         GlobVec = 1
  24.      #
  25.  
  26. To have the SCRIPT: device automatically available when you boot your Amiga, add this line to the s:startup-sequence file on the boot-disk using an ASCII editor:
  27.  
  28.     mount SCRIPT:
  29.  
  30. If your Amiga is in a "normal" configuration with all system directories,
  31. files, and commands where they are on the WorkBench 1.2 disk, you can install
  32. SCRIPT: automatically by typing EXECUTE EXECUTEME.  This is somewhat risky if
  33. your boot-disk deviates from the 1.2 or 1.3 distribution disk.
  34.  
  35. How to use:
  36.  
  37.      If you didn't add the MOUNT SCRIPT: command to your startup-sequence, you
  38. will have to type MOUNT SCRIPT: at a CLI/Shell before you can use SCRIPT:. You
  39. only have to do this once each time you boot your Amiga.
  40.  
  41.      The simplest way to use SCRIPT: is to type NEWSHELL SCRIPT: or
  42. NEWCLI SCRIPT:.  This is the equivalent of the 'script' UNIX command.  A CON:
  43. window will open, and you can use the CLI/Shell as normal.  Everything you
  44. see in the window will be saved to the file t:typescript.  When you have 
  45. finished doing what you want to be scripted, type ENDCLI or ENDSHELL.  This
  46. will terminate the CLI/Shell and close the file.
  47.  
  48.      You can change the file SCRIPT: uses by entering any valid AmigaDOS path
  49. after the SCRIPT:.  For example:
  50.  
  51.      NEWSHELL SCRIPT:df0:myfile            saves to df0:myfile
  52.      NEWCLI   SCRIPT:sys:foobar/boogley    saves to sys:foobar/boogley
  53.      NEWSHELL SCRIPT:PRT:                  sends file directly to the printer
  54.      NEWCLI   SCRIPT:NIL:                  sends the file to nowhere
  55.      NEWSHELL SCRIPT:SPEAK:                reads the file to you (slowly :)
  56.  
  57. I don't promise SCRIPT: will work if you don't include a device in the path
  58. name, but it seems to save the file to sys: if you don't.
  59.  
  60.      You can also change the device that gets scripted by using a colon : to
  61. separate the script-file name and the device name.  Using an empty script-file
  62. name will save the file to t:typescript.  Examples:
  63.  
  64.      NEWSHELL SCRIPT::NEWCON:0/0/400/200/MyWin    use t:typescript & NEWCON:
  65.      NEWCLI SCRIPT:PRT::NEWCON:0/0/400/200/MyWin  use PRT: and NEWCON:
  66.      NEWCLI SCRIPT:df0:myfile:AUX:                use df0:myfile and AUX:
  67.      NEWCLI SCRIPT:CON:0/0/320/200/Aux:AUX:       use CON: and AUX:
  68.      NEWSHELL SCRIPT:PIPE:a:SER:                  use PIPE:a and SER:
  69.  
  70. It is possible to script the SCRIPT: device.  This is useful when you need to
  71. send the input and output from some device to more than one place.  Say you
  72. have a modem and you're letting people login to your Amiga through AUX:.  You
  73. may want to have a hard copy of everything your remote users do, and also a
  74. small CON: window so you can watch the AUX: I/O.  To do this, you would use:
  75.  
  76.      NEWCLI SCRIPT:PRT::SCRIPT:CON:0/0/640/60/AuxSpy:AUX:
  77.  
  78. You can use as many SCRIPT:s as you want, but the SCRIPT: must always be the
  79. scripted device, never the file.
  80.  
  81.      All of the examples so far have used NEWSHELL or NEWCLI.  This is not
  82. necessary.  You can send a text file to the printer and the modem at the
  83. same time with this command:
  84.  
  85.      TYPE >SCRIPT:PRT::AUX: filename_to_print
  86.  
  87. You can make a file of the input to an interactive program like this:
  88.  
  89.      PROGRAM <SCRIPT:
  90.  
  91. These are just a few ideas.  SCRIPT: is a standard AmigaDOS device, and can 
  92. be used just like any other.  SCRIPT: works with all AmigaDOS devices for
  93. both the script file and the device to be scripted.  
  94.  
  95. NOTE:  The Shell, and possibly the CLI, print a control "O" before the prompt.
  96.        I assume this is so that if a command prints garbage for some reason,
  97.        the prompt will return the output to normal.  Unfortunately, ^O does
  98.        strange things to printers.   For this reason, I have changed all the
  99.        ^O's that get sent to the script-file into nulls (\0).  The ^O's are 
  100.        still sent to the device being scripted.
  101.  
  102. Using with WorkBench:
  103.  
  104.      SCRIPT: can be used with any WorkBench program that uses the WINDOW tool-
  105. type.  SCRIPT: works exactly as described above when used with WorkBench.  To
  106. get a WorkBench program to use SCRIPT:, select its icon and go to INFO under
  107. the WORKBENCH menu.  Either add or modify the WINDOW tool type to use the 
  108. SCRIPT: device.  For example:
  109.  
  110.       WINDOW=SCRIPT:                   uses t:typescript and CON:
  111.       WINDOW=SCRIPT:PRT::AUX:          uses printer and AUX:
  112.  
  113. BUGS:
  114.       
  115.      The current version doesn't do enough error checking.  I figure this isn't
  116. a big deal - if SCRIPT: can't allocate 60 bytes or open DOS, you're about to
  117. GURU anyway :)  I'll clean this up if I receive enough support.  The coding is
  118. also a bit messy.  I'll fix it if I receive ALOT of support (i.e. donations :).
  119.  
  120.      Error messages are not very descriptive.  If it can't open either the
  121. script-file or the device for whatever reason, it says "Object not found."  If
  122. it gets a request that it doesn't understand, it says "Packet type unknown."
  123. Errors in reading/writing are detected as actual lengths of -1, but the error
  124. messages for them are random.  (This one's fairly easy to fix.)
  125.  
  126.      ARP / ConMan / WShell - SCRIPT: is NOT ConMan.  Any commands or features
  127. that depend on talking directly to ConMan will not work with SCRIPT:  This is
  128. not a bug.  Features of these programs that do not depend on ConMan will still
  129. work with SCRIPT:, for example:
  130.   
  131.      NEWSH SCRIPT::CON:x/y/w/h/title/23/c
  132.  
  133. Future plans:
  134.  
  135.     The current version can only deal with open, close, read, and write 
  136. requests.  I'd like to fix it so that any unknown request gets passed to the
  137. device being scripted before giving up.  This should give ARP/WShell/ConMan
  138. their full functionality.
  139.  
  140.     The next version will have enviornment variables for the defaults.
  141.  
  142. To contact the author:
  143.  
  144. Richard Rogers
  145. 1811 Summit Ave. #210
  146. Seattle, WA 98122
  147.  
  148. email:
  149.  
  150. rrogers@seattleu.edu
  151.  
  152.  
  153. William Hammond has provided a Public Domain filter program that can be used
  154. with SCRIPT: to provide spoken I/O for blind Amiga users.  If you are interested in this, send email to rrogers.