$VER: runargs.doc 3.0 (5.1.2001) #AREXX © Roger Hågensen To install this script just copy it to REXX: You also need the WBStartEmu archive to use the WB mode of this script. You can get the latest version at http://www.stephan-rupprecht.de/ If a file is NOT marked then the program is executed with just the args, if a file is marked then the program is executed with the file + the args. It is called by setting up T.H.E.'s sys:wbstartup/setKeyAndMenu like this (CLI MODE): MENU ADD NAME '"MultiView"' TITLE '"\Show\MultiView"' CMD "rexx:runargs.rexx CLI STACK=8192 System:Utilities/MultiView [] SCREEN" or like this (WB MODE): MENU ADD NAME '"MultiView"' TITLE '"\Show\MultiView"' CMD "rexx:runargs.rexx WB System:Utilities/MultiView" (WB Note) In WB mode the stack and args are ignored. Program args must be set in the program/file icons, stack must be set in the program icon. (Just as you normally do with WB progs etc... :) ALL EXPLAINED.............. runargs.rexx arguments/options usage show In AmigaDOS style: runargs.rexx MODE/A,STACK/N/K,COMMAND/A,ARGS/F MODE and COMMAND args are *required*, STACK and ARGS are optional. You can use COMMAND="My System:Utilities/Multiview" if you want :D Or better explained: The first arg is the MODE to be used, this can be CLI or WB. The second arg is the stack size, this only works with CLI tough. Due to limitations in workbench.library the wbrun command can not set the stack, however the stack set in the icon is used instead. (which is just as nice a way of doing it, since you just change the stack in the program icon instead of having to edit your stack setting in the menus :) In other words, it's just as if you double clicked the program icon :) The third arg is the path/name of the command/program, you MUST use full paths. (really important with WB mode) The rest of the command line can be used for program spesific args. (Tough if WB mode is used the arguments are ignored, put the arguments in the program icon (tooltypes) instead. If the program doesn't support tooltypes, then use CLI mode instead) Please note that ALL of the remaining line is taken as args, it's even possible to specify (in T.H.E. or a compatible prefs util) rexx:runargs.rexx cli stack=8192 "ram:Rename Me/multiview" requester pubscreen="DOPUS.1" This text.... requester pubscreen="DOPUS.1" Is passed DIRECTLY to multiview, even the "" around DOPUS.1 Even blank spaces are pass to the command/program, this gives you a lot of power when using the CLI mode. So you should be able to the exactly the same now as you did with ToolsDaemon or similar multimenu tools.... Oh! And if you are used to ToolsDaemon you probably know that [] specify that the filename should be inserted in that place. Very nice for stubborn CLI utils that depend on the locations of it's options. Please note that there is no need for [] when using WB mode since RunArgs will automatically handle any icon you may or may not have selected on the Workbench... Nice huh? :D Have fun! HISTORY v1.0 - First attempt. v1.1 - Some improvements! v2.0 - 30/31 December 2000 Now handles WB/CLI launch and stack & args (CLI only). (WB Note) Program args must be set in the program/file icons, stack must be set in the program icon. v2.1 - 31 December 2000 Rewrote mostly everything, should work better now! Updated the docs a little! Put everything into an archive! (nicer this way ;) v2.2 - 2 January 2001 Ooops! Just noticed a stupid bug, forgot some '"arexx"' quoting. Now spaces in paths should no longer be a problem... v3.0 - 5 January 2001 New: WOW! Amazing, now even ToolsDaemon [] arg markers are supported, but there's more....... Proper AmigaDOS CLI args are supported now, so you can use STACK=8192 etc :D Now it should be VERY easy to convert ToolsDaemon menus directly into a WB compatible one. There will be no further changes in the RunArgs options, so you can safely change your menus now :D Fixed: Spaces in command names should no longer be a problem... Improved: Better wb path checking, nicer space handling etc. Updated docs to brag about and explain the changes... FUTURE Try and support multiple file selection and launching. Try and support files "left out" on the WB backdrop. WHAT WILL NOT BE SUPPORTED ToolsDaemon's Asyncron execution lists. (create a dos script instead)