Well another month has come and gone and it's time for ol Bodacious Bodean to fill your heads with more programming tips. Our own Paul Lara had a question this time that I thought would be worth answering this issue. His request was to be able to have a different image come up in the Toaster program buffer instead of the VTLogo everytime. This turned out to be a little more of a challenge than I thought it would, but I DID figure it out.
For those that don't know it, the Logo that comes up each time is simply a Framestore image that is called VTLogo. It is located in the Toaster:Programs/Switcher_Support/StartupFrames drawer. So if you don't normally go digging around in subdirectories you probably didn't know that.
If you have a custom image , say one with your company's logo that you want to boot up every time then just copy the new Framestore to that directory and rename it VTLogo. The next time you boot your Toaster, your logo will appear instead of the standard Newtek Logo. However, since Paul wanted a random picture to come up each time, I had to figure out something different.
At first I thought, ok all I have to do is call the random command from Arexx and pass it a new name each time, but alas, the random command in Arexx ain't so random. The problem is each time you start it from a script, it does spew out random numbers but the next time you run it it gives you the same order of random numbers. This means that the first random number will be the same each and everytime. Not so good to use for this routine, so, I thought "Hey - how about the timer?" This would pass a value that was always different and yes indeed it would work. What I needed was the last number (which would be seconds) this way it will always give me a number from 0 - 9. So the first thing is to pull that number out of the current time like so:
Num = right(time('S'),1)
This tells Arexx that I want Num to equal the last (right) character in the current time and that I only need 1 character. Since you have 10 possible numbers, you can have 10 possible pictures to pull from. However, if you don't want that many you will need to add a few lines to take care of that. I had 4 pics that I really liked so my example went like this:
if Num > 4 then Num = 4
This tells Arexx that if the number is between 5 - 9, turn the number into a 4, and if the number is 0, then turn it into a 1. You can change the 4 value to whatever number you want up to 9 (well really to 8 cause there would be no need if you had it up to 9.
Next you need to have the files that you want placed inside the correct drawer. I called my pictures StartUp.001, StartUp.002, etc. and placed them into the Toaster:Programs/Switcher_Support/StartupFrames drawer. If you want to keep the VTLogo, make sure to rename it first or copy it to another drawer because this script will copy over it. I just renamed it StartUp.004 and made it one of my custom pics.
The last thing you have to do is add the following lines to your StartToaster script (or whatever script you boot your Toaster with). Now you need to put these at the TOP, not at the bottom where you place most Arexx routines because the Toaster loads the image prior to getting to them, so I placed them right after the lines
OPTIONS RESULTS
Here are the lines you need to add:
Num = right(time('S'),1)
Thats all there is to it. The first 3 lines we already discussed and all the fourth line does is copy the random image to VTLogo and your done.
With all the talk on Hot keys in this issue I thought I would pass along a simple little idea that Kermit of Nova Design told me about. If you use Image FX with the Toaster/Flyer you know that when you want to send an image to the buffer you have to goto the render module then hit "Transfer" to send the file on over. Well if you are busy working on an image and making a lot of changes this can be very time consuming and a real hassle. Well the little tip is this. Bring up the "Default.keys" file found inside the ImageFX drawer into your favorite text editor. This is where you can assign custom keys to be whatever you want them to be. I selected F10 to be my hot key and for the command you simply put "Render Go". Save it back out and now you can hit F10 anytime you are drawing and it will ship your image over to the Toaster buffer.
Until Next time....
Bodean
Back To The Table Of Contents
|