By J.L. White

owdy, Welcome to our second installment of BBBB. In this issue I will explain the mystery of the Programs menu bar of the Toaster Flyer and how you can edit the StartToaster script to add your own programs to the list. The programs menu option of the Toaster allows you to access all of the Newtek related programs which are Lightwave, ToasterPaint, ToasterCG, and ChromaFX.

Through the Toaster Arexx command list you can also run other programs from this menu, however because of the way the Toaster works, it does not open up a standard Amiga screen and if you try to run a regular program on top of it, it can lock you out of the system. In this issue we'll explain how you can get around this very easily. I will explain two methods of adding programs. One for those that do not require any input from the user and do not require a screen to open, the other will be to add a program such as ImageFX.

If you remember from our last issue we edited the "StartToaster" file. If you do not remember how, please go read the last issue now. Once you have the file open in Ed, go to the section where we can add our commands which is right below

/* Add Startup Code here... */

For this example we will be adding the Newtek program called "VoidAll". If you are not familiar with this command you should be. Once you have played a few projects and made some edits here and there, the Flyer will start to have bits and pieces of clips that it creates and which may slow up the system and cause some jitter during play back. For now you must go to a shell and type in the "VoidAll" command and it will go through your Flyer drives and delete those unneeded bits and give you back that jitter free playback you so richly deserve. By adding this command to the Program menu, you never have to leave the Flyer Screen nor open a shell window. What you need to add to your "StartToaster" file is this:

call AddProgram("  Void All","run C:VoidAll",0)

This command will add the Void All function to your Program menu. The first part of this command is simply the name that will appear in the menu. The second part is the actual command, The number 0 tells the Flyer it is a dos command. If it were an Arexx command you would pass it a 1 instead of a 0. For those that own Control Tower (yet another plug) we have this command already set up for you as a macro called "Void_All.rexx" It gives you the added ability to tell it how many times to run it. I normally run it twice just to be on the safe side. It also comes up with a small window to let you know how the progress is coming along and when processing is done. Besides that, it works the same as this example.

The reason this example is so simple is because the voidall program does not require any input nor does it open its own window or screen. Many other programs do, but that would not work on the Flyer because of the way they handle their screen, so the 2nd example will show you how you can run other programs that do open their own screens. I will show you one that I wrote for ImageFX, that not only goes and runs it, but checks to make sure if it is already running, it just flips to that screen instead of running a second copy of it. You will need to add a line to the "StartToaster" file as well as create a new file. The line to add is:

call AddProgram("  ImageFX","run SYS:rexxc/rx ImageFX:IFX.rexx",0)

You may notice that this is an arexx script but it still has a 0 not a 1. The reason is when you run an Arexx command it will not return control to the Flyer until it is done. This way I call the Arexx command "RX" to start the Arexx script in the background and return command to the Toaster right away. Below is the script you need to write to work with ImageFX. Save it in the ImageFX drawer and name it "IFX.rexx".

--------------------

/* Arexx Script to run ImageFX from the Toaster Flyer */
options results
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
call addlib('ToasterARexx.port',0)
call addlib('PROJECT_REXX_PORT',0)
call Switcher(TOWB)
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
if (POS('IMAGEFX.1',SHOW('Ports')) = 0) then do
Address Command "run >NIL: ImageFX:ImageFX
end
else do
Address "IMAGEFX.1"
ScreenToFront
end
exit

--------------------

The first line (if you remember) tells AmigaDos that this is an Arexx script. The next few lines are in almost every Toaster script. The option results line tells dos that commands may pass information back to the host that may be required. Next you need to close the Flyer libs - then open them again (I do not know why they have to do that but all examples from Newtek came that way, so follow their lead). The next line tells the switcher to flip to the workbench screen, then next you close the libraries AGAIN. The next bit is not needed for all programs, but when you know what the port of a program is, it allows you to check and see if it is running. If so, then you can just flip to that screen - if not then you can run it. That is what it is doing here. It checks to see if the port for IFX is open, if it is, it flips to the IFX screen then exits - if not then it loads IFX then exits. This is handy if you flip back and forth a lot and if you forgot you had IFX running in the background, the next time you use the menu to run it, it will just flip to the screen instead of running the program again.

Now that wasn't too hard now was it? Try creating some scripts yourself and see what kind of results you get. If you have any questions on how to do something with the Toaster Flyer, then send me some email and perhaps we can address it in a future issue.

Until Next Time,

Bodean


Back To The Table Of Contents
Copyright © 1997 Visual Inspirations