RndBackdrop V1.2 ScanPicDir V1.2 --------------------------------- Purpose ------- Two little programs I've written in ARexx, because similar programs on aminet did not support reloading of a random picture, in case I get annoyed of a picture but don't want to reboot (moreover WBPattern can't simply reload a picture by giving a picture as argument to it, don't know about WBPicture (NickPrefs) though.). Disclaimer ---------- No warranties are given for my ARexx scripts. Of course you can send me bug reports, see BUG section below. Copyright --------- Both scripts are Public Domain. You may use it as you wish, but it would be nice if you mentioned me somewhere when you include them in one of your programs, my name is Reinhard Katzmann and I live in Tuebingen, Germany. Introduction ------------ As I shortly scanned several backdrops I thought it would be good to find a program which selects a random picture and displays it on the WB screen. WBPattern (supplied with OS3.x) though only can only display one fixed picture. Therefore I wrote an ARexx script to do the job. Besides I had to find out that I could not simply give a picture as argument, but had to change the fixed picture file. To avoid search time, I wrote a second script which creates a backdrop list of your pictures (you might even want to change it by hand). From this list the other script selects a random picture and copies it to the fixed one. Usage ----- ScanPicDir scans one or more directories with backdrop pictures for your WB and builds a list which RndBackdrop uses to select a random picture. Usage: RX ScanPicDir Paths/M,P=Pattern/K,ALL/S,DIR/S,O=Outfile/K,D=Drive/K Outfile is preconfigured as sys:t/backdrops. Other arguments are similar the List AmigaDos Command with exception that Paths being only directories. To change the default output volumne name ("sys:") use the drive option. RndBackdrop selects the picture and copies it to the fixed file. You can use it in your User-Startup (before loading WB) or as online command. Actually none of the arguments below must be given to run the script. Usage: RX rndbackdrop TO,I=Infile/K,T=TMPFile/K,P=TMPPrefs/K,R=RELOAD/S,MSG/S,D=DRIVE/K TO is the name of the fixed picture file (defaults to sys:t/bdpic). The name of this pictures must be also the name of the pic in WBPattern (be sure to have actually copied a pic file before calling WBPattern :-) Infile is the the name of the picture list (every entry must have the full path of the pic). If you use the MSG switch, you will see which file has been choosen by the program. That are all arguments needed for User-Startup usage. If you want to change the backdrop AFTER the Workbench has been loaded you must give at least the RELOAD switch as argument. The ARexx script must rename the backdrop file to TMPfile (default oldpic) (because WBPattern has a lock on it), then copies as above and calls WBPattern itself twice (*sigh* you cannot simply use the same prefs with WBPattern again, WBPattern will not reload the new picture, a notify would be helpful here, Amiga International ? :-), one with an empty prefs (you can use the one I included) TMPPrefs and after that the original Prefs. Then it waits a second until the lock is away and deletes the old picture. (Hope your mind has no knot after this paragraph ;-) If you don't own OS3.x, but use instead OS2.x including WBPicture (or a similar program), you might set the ENV-Variable WBBACKDROPCMD (default is for OS3.0 User: 'WBPattern use' (without quotes) ). Didn't test this, though. Bugs ---- Not that I knew some ;-). The only thing I encountered is a general problem with csh (5.43) and ReadArgs() from RexxDosSupport. But I think it will be generally used from User-Startup or as WBScript or from ToolsMenu. Note: With 5.50 of csh I did not encounter any problems up to now. If you still have bugs/problems/ideas/, feel free to send me an email. EMAIL ADRESS: Suamor@student.uni-tuebingen.de (Reinhard Katzmann) History ------- V1.0 - Initial release V1.1 - Added Drive Option to both scripts. - Checks if the filename of the file to be handled really exists. - If it the file does not exist a new one is selected until one is found, which exists (Attention: This might lead to endless loop if no file in the pic list is valid, you have been warned!) - The copy command for the selected picture no longer puts error messages on screen, if something failed. - No longer uses 'dh0:' as default volume name, instead uses 'sys:' V1.2 - The new template broke the whole prgram :-( I=Infile uses I as variable. Therefore I have exchanged the template item synonyms.