ToolsX and ToolsXConfig Documentation by Steve Tibbett Version 1.00 NOTICE ToolsX and ToolsXConfig (TX and TXC from now on) are programs meant for use under Kickstart 2.0 and are totally useless under 1.3. OVERVIEW These two programs let you add items to the 2.0 Workbench TOOLS menu. The items you add to the menu can also have a Hotkey associated with them, provided the commodities library is available. (It normally is under 2.0 unless you erase it). ToolsX is meant to be put in your WBStartup drawer and forgotten. It will read the environment variable that ToolsXConfig creates, and adds the items to the Tools menu. It then goes to sleep waiting for either menu selections, or hotkeys to be hit. ToolsXConfig is where you define what ToolsX is going to do. You can add menu items, delete them, assign hotkeys, stack size, and home directory, to each menu item. FEATURES - Allows you to put menu items on the Workbench Tools menu. - Lets you attach a hotkey to each of the menu items. - Uses Commodities - the hotkeys use standard commodities definitions and ToolsX can be controlled via Exchange. - Gives a proper path to spawned programs even if ToolsX is started from the WBStartup drawer. - Very easy to install - Graphic user interface for editing tools menu items. - Allows you to specify a home directory and a stack size for each individual menu item. INSTALLATION Drag ToolsX's icon into your WBStartup drawer on your System partition or floppy, and put ToolsXConfig somewhere convenient. The Prefs drawer would be a logical place for it to live, or perhaps in the Tools directory. Now run ToolsXConfig and add the items to the tools menu that you want to be there. Exactly how to do this is described in the section on ToolsXConfig, but the program has a graphic user interface that you should be able to use without having to read the documentation. I have also included a very simple ToolsList containing just a single menu item which starts a Shell window when you select it from the menu, or press Control-Shift-F1. If you want to use this, copy it to ENV:ToolsList before starting ToolsXConfig or ToolsX. TOOLSX ToolsX reads the file "ENV:ToolsList", and adds the tools to the tools menu that the file specifies. The "ENV:ToolsList" is created by >ToolsXConfig. ToolsX can be placed in your WBStartup drawer. This is the best way to run it, as everything in the WBStartup Drawer is automatically loaded when you reboot, by Workbench. ToolsX has code in it (supplied by Mike Sinz) to get a proper path, so shells launched from ToolsX will have the proper path. (Normally programs started from WBStartup do not have a path). If you are just using Workbench, the path is of no concern to you. TOOLSXCONFIG This program is how you talk to ToolsX. When you run this program, it will open a window with a scrollable list in the center of the window showing you the tools currently in the list, and gadgets for adding, deleting, and editing existing tools. There are also 3 gadgets at the bottom of the window for Save, Use, and Cancel. There are two ways to add items to the list. One is to click on Add, and fill in the requester that will pop up asking for the Title (the text that goes into the menu), the command itself, what directory the command will be executed from, the hotkey that will activate this item (or an empty string for no hotkey), and the stack size. The other way is to just drop a Workbench icon into the TXC window! The program that the icon would call up if you double-clicked it will be in the Command field, the name of the icon will be the Title, and the stack size and directory will come from the icon. When you select SAVE, the ToolsList file is written to ENV: and to ENVARC: where it will be stored permanently. (The standard 2.0 startup-sequence copies the environment variables from ENVARC: to ENV:). Selecting USE will save the ToolsList to ENV: only - not to ENVARC:, so the changes will only last until you reboot. When ToolsXConfig exits, it signals ToolsX (if it's running) that it should take another look at the ToolsList file. This way, your changes take place as soon as you select SAVE or USE, rather than having to reboot to see them. In the requester where you edit or add new tools, there are 5 fields that you can fill in. The first one, "Title: ", is informational only - this is the text that shows up in the Tools menu. The next field, the "Command: " field, is the name of the program to load when this item is selected. The command's current directory when it is started will be the "Directory: " field - so if you want to add "DPaint" as the Command, and DPaint was in WORK:DeluxePaint, then you could set the Directory: to WORK:DeluxePaint. Or you could put WORK:DeluxePaint/DPaint as the Command: and have WORK:Pictures as the Directory. The latter way would have the WORK:Pictures directory be DPaint's current directory, so when it opens a file requester, it would show that directory. If you select a command's menu item with one or more Workbench icons already selected, then those icons will be the arguments for the command being started. If the command has a "%s" anywhere in it, then the %s will be replaced with the name of a single command - if the command has a %l in it, it will be replaced with a list of ALL the icons currently selected. For example, if you select IconOne, IconTwo and IconThree and select a tool menu item whose command is 'Echo %s', then it would behave as if you had typed 'Echo "IconOne"' and then 'Echo "IconTwo"' and then 'Echo "IconThree"' - the command is started once for each selected icon. If the command was 'Echo %l' then it would be as though you had typed 'Echo "IconOne" "IconTwo" "IconThree"' from the CLI. (Note that the arguments that ToolsX inserts are always quoted). The Stack: field will be the stack size for the program being started. If you don't know what to put here, put in a number like 8192 - some programs need more stack. If a program crashes randomly, increasing the stack may help. The Hotkey: field is where you specify what keystroke you want to start this program. These are global - no matter what window you are currently working in, if you hit this keystroke, then this program will be started. Be careful to avoid conflicts with keystrokes your normal programs may use. The strings that you can put here to say what key you want to use are documented in the AmigaDOS manual, in the section on commodities. If any of your menu items have a hotkey, then ToolsX becomes a commodity - running Exchange will show ToolsX and let you Enable, Disable, and Kill it off. ADDTOOLS If you used my earlier AddTools program, then you've probably got a ToolsList in your S: directory. To update this to the new format that ToolsX uses, simply add two blank lines after each entry. You'll have to save this new file to ENV: and to ENVARC:. (AddTools used 3 lines for each menu item, ToolsX uses 5). ToolsX is AddTools with the 3 most requested features added: Hotkeys, a GUI, and an X on the end of the name. 8-) QUITTING There are two ways to quit ToolsX. One is to find it's task and send it a BREAK signal - if you have run ToolsX from the WBStartup drawer (as you should!), then the tools that come with AmigaDOS will not let you send it a Break signal. But if any of your menu items have a hotkey, then you can run the Exchange program (in the Utilities directory of your Workbench disk), and it will show you ToolsX in it's list of commodities. Select ToolsX, and select "Kill" and all the ToolsX-added tools will disappear from the Tools menu, and ToolsX will exit. CREDITS Thanks go to Craig Dorrell, Jim Ogilvie, and Ken Robinson, for testing and suggestions, and to Mike Sinz for the WB2CLI() code that lets ToolsX have a proper path even when started from the WBStartup drawer. THE AUTHOR You can reach me via Portal (SteveX), Usenet (SteveX@cup.portal.com), my BBS (613-731-3419), or voice phone (613-731-5316). Since you're obviously using 2.0 if you're using ToolsX, look for other 2.0-enhancing programs by the same author. PointerX puts a spin on the Workbench Busy pointer's clock, and AssignX will add an "Assign..." and "Mount" buttons to the "Retry" and "Cancel" buttons on those pesky "Please insert volume..." requesters. COPYRIGHT These programs are Copyright 1991 by Steve Tibbett. These programs may be freely distributed, unaltered.