* WHAT IS A SCRIPT? * * * * * * * * * * * * * * * * * * * * * * * * * * A script is a list of AmigaDos commands and filenames. It is structured in such a way that it becomes a very useful part of the operating system. This catalogue is mostly put together by using many different scripts and as a result it all works very well. * WHY WOULD I NEED ONE? * * * * * * * * * * * * * * * * * * * * * * * * Well, if you do not have a program or utility which can use graphics, text, animations, different fonts etc then you will need something to pull all these bits together. A script is the answer. Although sometimes a scripts just tells one program how to control files ie, display them, play them without using many other programs. * WHAT DOES A SCRIPT LOOK LIKE? * * * * * * * * * * * * * * * * * * * * A script is an ascii file (standard text file) with AmigaDos commands in. You can create a script by using any word-processor which supports ascii format - most of them do. The script below is used to play some music, load a Scala script (video graphics) and then ask you if you would like to see the Scala script again. ______ __ / ____/ / / / /_ __ __ ______ _ _ ______ / / ______ / __/ \ \/ / / __ // \_/ \ / __ // / / ____/ / /___ / / / __ // /__/ // /_/ // /_ / __/_ /_____/ /_/\_\/_/ /_//_/ /_// ____//___//_____/ / / /_/ +----------------------------------------------------------+ | | | NOISEPLAYER -P5 DH0:MUSIC/MODS/MOD.FANTASY | | DH1:DESIGN/SCALA500PLAYER DH1:ART/SCRIPTS/CAT.SCRIPT | | ASK "DO YOU WANT TO SEE THE CATALOGUE AGAIN? Y/N" | | IF WARN | | DH1:DESIGN/SCALA500PLAYER DH1:ART/SCRIPTS/CAT.SCRIPT | | ELSE | | ECHO "GOODBYE!!!" | | ENDCLI | | ENDIF | | ECH0 "GOODBYE!!!" | | ENDCLI | | | +----------------------------------------------------------+ * WHAT DOES IT ALL MEAN? * * * * * * * * * * * * * * * * * * * * * * * The very first line: NOISEPLAYER -P5 DH1:MUSIC/MODS/MOD.FANTASY Is instructing Noiseplayer (PD Music program) to play Mod.Fantasy which is on a hard-drive. Note -P5 is only used with Noiseplayer - it is telling the program to quit the music when the ESC(ape) button is pressed. The second line: DH1:DESIGN/SCALA500PLAYER DH1:ART/SCRIPTS/CAT.SCRIPT Is instructing the Scala500Player to load Cat.Script which is on the hard-drive. The third line: ASK "DO YOU WANT TO SEE THE CATALOGUE Y/N" Is using an AmigaDos command. It gives the user an option to view the catalogue (Cat.Script file) or to simply bypass it. The ASK will only accept a Y or N reply so "Y/N" has been displayed. The forth line: IF WARN Is another AmigaDos command. IF WARN tells the computer to go ahead and view the catalogue again. The fifth line: DH1:DESIGN/SCALA500PLAYER DH1:ART/SCRIPTS/CAT.SCRIPT Again instructing the Scala500Player to load Cat.Script which is on the hard-drive. The sixth line: ELSE ELSE is the opposite to IF WARN (Yes), therefore it tells the computer to ignore the catalogue file. When giving an ASK command you must use both ELSE and IFWARN because the user could always use them both. The seventh line: ECHO "GOODBYE!!!" An AmigaDos command which instructs the computer to display whatever is in inverted comers. Note this command isn't too flexible and will limit the amount of lines you can display, it will do this by rejecting the command. The eighth line: ENDCLI A very common AmigaDos command which will get rid of the shell/CLI window. The ninth line: ENDIF Another AmigaDos command which ends the whole script. The lines which follow will close the script down. They have been repeated before. * CREATING YOUR OWN SCRIPT * * * * * * * * * * * * * * * * * * * * * * 1. Type the script out and save it in ASCII format (if there is not an option to do this, it will probably be done automatically). 2. Load a icon program ie, IconEdit which is supplied on the Workbench disks. Once the program has loaded drag the script icon into the main window, it will be displayed. Go to the pull-down menu and change the tool-type from Tool to Project. (See "Icon Types") Exit the program. 3. Select the script icon and either press the right Amiga button and "I" or go in the pull-down menu and select information from there. 4. You will be presented with a huge window of information about the file "behind" the icon. 5. The right-hand side looks like this: _ Script |_| ( *** Tick this box *** ) _ Archived |_| _ Readable |_| (Ticked) _ Writable |_| (Ticked) _ Executable |_| (Ticked) _ Deletable |_| (Ticked) 6. The middle column should look like this: ________________________________________ | | Comment: | | |________________________________________| ________________________________________ | | Default Tool: | ICONX | |________________________________________| Type IconX in the default Tool box as shown above. IconX is an AmigaDos command, which lets a script be used with an icon. 7. The script is now ready and can be run at any time - Save it to disk immediately. Although this step-by-step guide has seemed quite long you will eventually get the hang of it and will be whizzing off scripts and the necessary icons with-in seconds. Trust me I can! * REMEMBER * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * The above script is just an example of what can be achieved. However if you study the AmigaDos Commands document on this disk and remember the following you will not go far wrong. When including ASK in a script use ELSE, IF WARN and ENDIF to finish the script. If you find the script is running too many programs at once and you want to slow them down or run them at different times, use the WAIT command. This tells the computers to Wait... Surprised? If you have a document and want to display it on screen but do not wish to type this out in the script or it is too long for the ECHO command to handle, then use the TYPE command with a path to the document ie, TYPE DH1:TEXT/AMIGA.DOC. * NOTE * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * If you want a program to load a file by using a command line, always remember to type the path of the program first, then the path of the file after. IE, DF0:DPAINT DF0:ART/MONKEY.IFF The above line is instructing DPaint to load the Monkey.IFF picture.