home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 337.lha / WBScript / WBScript.doc < prev    next >
Text File  |  1990-02-07  |  8KB  |  155 lines

  1. For all those who have ever had a grudge with the Workbench, this program's
  2. for you.  Macintosh users are used to point-and-clicking and having it work
  3. every time (except on data files).  Remember the time that you thought you
  4. could simply drag a program by its icon onto your hard drive, double-click
  5. it and have it work?  There were always library files and assigns and
  6. startup-sequence entries.  Until now.
  7.  
  8. This program lets people with CLI experience make the Workbench idiot-proof
  9. for themselves and others.  WBscript lets you place scripts into project
  10. icons.    When you double-click the icon, the script is executed from a
  11. console device (CLI) of your choice which has a current directory of the
  12. icon's location, or a directory named in the project icon.  In this way,
  13. when you write your scripts, you do not even have to supply path names to
  14. files and the script will still always find them.
  15.  
  16. Why a put a script into a project icon, you ask?  And how can it be
  17. associated with a directory full of stuff?  There are several advantages to
  18. placing a script inside a .info file rather than a separate script file.
  19. Any icon will associate itself with a file or directory of the same name
  20. regardless of whether it is the proper type.  A project icon will attach
  21. itself to a directory.    When you drag it around, it will carry the entire
  22. drawer, but it will not allow you to run the program or open the drawer in
  23. the regular manner.
  24.  
  25. If you had a program with some related files that you wanted to keep in the
  26. same directory but the program wants to find in your system directories
  27. (terminal programs for instance), you could transform its directory's
  28. drawer icon into a project icon and put the CLI commands in there.  The
  29. current directory of the script is whatever directory the icon is in so
  30. that your script can refer to items inside that directory without full path
  31. names.    Now, you will be able to pick up the directory and move it wherever
  32. you want while carrying all the related files, but when you double click it
  33. will run the program.  With a special tool type entry, you could freely
  34. change the name of the directory and not have it effect the execution of
  35. the script file.
  36.  
  37. A possible application would be if you had a program that requires some
  38. assigns before it is run.  Instead of having a separate script file,
  39. startup-sequence entry, or to type the commands every time, you can
  40. transform the program's tool icon into a project icon and put the assigns
  41. right in there.  It is now one integrated package that when double clicked
  42. will run the program properly and when dragged will carry the icon, script,
  43. and program.
  44.  
  45. Since the commands are true scripts, it is totally appropriate to use "if"
  46. statements.  You can create documentation icons that aggressively determine
  47. and use whatever reading utility a person happens to have on their system.
  48.  
  49. Of course, WBscript will also allow you to do things from the Workbench
  50. which just weren't possible before.  CLI-only programs can be attached to
  51. icons and be able to be dragged with them.
  52.  
  53. A clever Workbench user will be able to assemble packages that will make
  54. them seem to have programming ability.    For instance, by putting the
  55. SuperView utility inside a directory with a bunch of pictures, you can run
  56. an entire slide-show by clicking the directory icon and copy the whole
  57. thing to your hard drive by dragging that same icon.  People are likely to
  58. never even realize it is not a program they are running.  You can put
  59. WBscript inside that directory and set the path to it so that people don't
  60. need to already have the program.
  61.  
  62. I made a WBScript utility that will attach icons onto all files in a
  63. directory by simply dragging an icon to the drawer from Workbench and
  64. double-clicking it.  When you closed the drawer and opened it, there laid
  65. out in neatly placed order were icons belonging to the previously invisible
  66. files.    All I used that was not standard Amiga DOS was WBScript and LS, a
  67. versatile listing command with a NOT operator.    You can probably figure out
  68. the rest.
  69.  
  70. You can see WBscript's CLI parameters by typing "wbscript" in a CLI or
  71. shell.    Operation should be pretty obvious for anyone who is already
  72. familiar with CLI formats.  You can change several things about an icon
  73. from there.  If you already have a script file prepared, you can set the
  74. type of the icon to project and load the script into it and be in business
  75. with little work.  In order to see the changes you've made from the CLI,
  76. you must remove it from Workbench's view then reintroduce it by closing the
  77. drawer it resides in then reopening it.  Now when you do an info on it, you
  78. will see the change.
  79.  
  80. The script files can be created in any text editor and saved as a file
  81. temporarily.  The script can then be transferred into the .info file by
  82. typing from a console:
  83.       wbscript load <icon file> <script file>
  84.     e.g.: wbscript load Program script
  85. This will load a script named "script" into an icon named Program.info.
  86. You do not use the ".info" extension on the icon names in these CLI
  87. operations.
  88.  
  89. To implement WBscript, you should copy it to your C: directory and enter
  90. "C:WBscript" as the default tool in project icons.  If you didn't put
  91. WBscript in the C: directory, you will have to supply a path name to where
  92. it is.
  93.  
  94. The way WBscript works is it dumps the icon information into a temporary
  95. file and executes the commands out of that.  It writes to a file in your T:
  96. directory called Temp-WBscript(n).  If you don't already have your T:
  97. directory assigned to RAM:T, I would recommend it in order to minimize
  98. useless Macintosh-like disk writing.
  99.  
  100. WBscript needs to refer to a console creating command like newshell,
  101. newcli, or ashell.  It defaults to newcli.  If you don't have newcli on
  102. your system, you can enter a tool type of:
  103.     SHELL=<COMMAND>
  104.   e.g.: SHELL=C:Ashell
  105. The shell windows that are created have executed the shell-startup file.
  106. In order to invoke a CLI without a shell-startup being executed, the tool
  107. type entry can be made:
  108.     CLI=<COMMAND>
  109.   e.g.: CLI=newcli
  110. The size of the console window that WBscript must open can be set to
  111. something other than default by entering a tool type of:
  112.     WINDOW=<CONSOLE PARAMETERS>
  113.   e.g.: WINDOW=newcon:50/50/400/200/Hello!
  114.  
  115. One of the most unique and powerful features of WBScript is its ability to
  116. set the current directory for the script that will be executed.  This
  117. eliminates the need to use path names in your scripts or to worry about
  118. changing the name of the directory from Workbench.  To activate this
  119. feature, make an entry into tool types of:
  120.     CURDIR=drawer
  121.  
  122. In order to debug your scripts, you can closely monitor the execution of
  123. the script by entering a tool type of:
  124.     DEBUG=1.
  125. When you have things working properly, you should discard this entry.
  126.  
  127. It is important to remember that the first half of a tool type entry must
  128. be in ALL CAPITAL LETTERS!
  129.  
  130. The order of the entry is not important.  These entries may be anywhere in
  131. the tool type sequence and have the same results.  This also applies to the
  132. order of the script command entries.  They are numbered as P0=, P1=, P2=,
  133. etc., and will always execute in their numbered order regardless of their
  134. position in the sequence.  So you should feel free to operate right in the
  135. icon info window.  Delete and add as you please.  Small script files can be
  136. completely entered in this manner.  You can number your entries in large
  137. intervals to accommodate future entries like you would in BASIC.
  138.  
  139. The effect of this program on the Amiga computer overall is very promising.
  140. Those of us who understand scripts can make operations form Workbench
  141. fool-proof, thus eliminating one of the major complaints about the Amiga
  142. (mostly by people who are used to Macs).  It does not change anything in
  143. the standard Amiga system; it merely better utilizes what is already there.
  144. It will also eliminate the need for installation programs.  The only thing
  145. that will make its full potential come forth, is people putting WBScript in
  146. their C directories and using it.  Because of that, I have included a
  147. WBScript application that will copy WBScript into your C directory.  To see
  148. what it is doing, do an info on the icon.
  149.  
  150. If you find this program useful and please send $10 (or whatever) to:
  151.  
  152. Howard Harrison
  153. 418 Centre Avenue
  154. Jeffersonville, PA 19403
  155.