Sample KeyQuencer macros
by Judy Engelsberg <Judy.Engelsberg@pics.com>

Here are a few macro samples to get you oriented with the simple macro language. Complete documentation is found by clicking the help icon in the control panel and selecting About Keyquencer. After you're feeling comfortable with Keyquencer's environment, and have written a few of your own macros, you will find that Keyquencer almost writes them for you!

1. Launching an application
Let's create a macro to open the Macro Editor. For the sake of this sample, move the macro editor to the desktop.

You can create your macros within the Keyquencer control panel or within the Macro Editor. With the Keyquencer control panel active, press shift-N to create a new macro. Let's name it 'Open Macro Editor'. Press the tab key and give the macro a key combination to activate it. I used shift-control-M. Choose what you like. Press the tab key. This is where we write the macro script. Scroll the list of commands in the box at the middle-left until you can see the Open command and click it twice.

Notice that the command is added to your macro script. Also notice that all the related subcommands for the "Open" command appear in the box on the right. Now look at the two text boxes at the bottom of the window. The top text box explains what the command, in this case "Open", does. The bottom box gives the syntax for the use of the command. The subcommands are listed roughly in the order they will be used in the macro script. Double-click on the subcommand "application". Keyquencer continues to build the script. Now you must include the path of the application within double-quotes. Now scroll the subcommands and then double-click on the item "desktop". Type "Macro Editor" (include the quotes here). That's it! The whole command should be:

Open application desktop "Macro Editor"

Note your macro key command and click the OK button. Enter the macro key and the Macro Editor should open!

Not impressed? OK. Put the macro editor where you really want to keep it (hopefully buried a few folders deep). I usually keep Keyquencer in the folder called Keyquencer 1.2 in my folder called "Utilities" on my hard disk called "File Cabinet". The Macro Editor looks pretty empty. Choose "Build This Menu" from the Extensions Menu. Hopefully this won't take too long on your machine. The Editor goes out to your Keyquencer Extensions folder, does an inventory, grabs each extension and builds the help menu. Each command and its related help text is listed and as it is selected. Related subcommands are shown in the submenus. Select the "Open" command from the menu. It is placed in the macro window. Click to deselect it. Select "application" from the "Open" submenu. Click to deselect it. Select "Disk:folder:..:file" from the Open submenu. Now choose "Insert Path" from the "Edit" menu, and find the folder that contains the Macro Editor. Select the Macro Editor application, then click on the "Open" button. Macro Editor enters the path to the file. My whole command is:

Open application "File Cabinet:Utilities:KeyQuencer 1.2:Macro Editor"

Your command should look similar, but match the location of the Macro Editor on your hard drive. You can copy and paste the macro text from the macro editor into a new macro in the control panel or you can save macros from the macro editor in a text file and open them when you need them to launch them. Close the macro editor after copying your macro. Put it into the Keyquencer control panel as a new macro and try your try it out. If you've done it right, the Macro Editor will open!

2. Automating a dialog
Now click on the file menu in the Keyquencer control panel. Choose Import Macros.. and locate your Sample Macros to Import folder in the Keyquencer folder. Select Finder Sequences and click Open.

Press "B"
That should bring you to, or very near the Better search macro. When it is selected, press shift-E. This opens the macro to edit it.

The following text will walk you through this macro:

SwitchApp "Finder"
You can execute this macro from anywhere. The first thing it will do is take you back to the application in quotes - in this case, the Finder.

Menu 2 12
This command will select a menu item. Menu 2 means the second menu from the left. In the Finder the first menu is the Apple menu. The second is the Edit menu. "12" stands for the twelfth item in the Edit menu - the Find command. Under what number system, you may ask? Well, counting from the top down, AND including the separator lines, Find really is the twelfth item.

Button 1
There is a handy way to count your buttons. Choose cancel for a moment. Press shift-N to make a new macro. Double-click on the command Buttonlist. Double- click on the subcommand visual. Call it Button List, give it a key command and choose ok. Now select Find and when the Find window is visible, execute Button List. Pretty cool! Now we know which is button 1. Clicking on the window once makes the button list go away. Then click Cancel. When you say Button 1 in your script, it tells the macro to press the More Choices button.

PopUpMenu button 3 item 1
Pressing the button brings us to a more complicated Find window. If you check it, button 3 in the More Choices menu is a popup menu. By specifying the first item, you're choosing the startup drive.

PopUpMenu button 1 item 2
This selects size from the popup menu.

Type "30"
As it says this arbitrary example enters 30 in the entry field. We're looking for files less than 30K on your startup disk.

Button "Find"
Here the button is specified by it's name. You can use either way to name a button. If one way doesn't seem to work for you, try another way.

*** Judy.Engelsberg@pics.com ***
Doing excellent software quality assurance-PC/Mac/PPC

