Getting the Most Out of System Macros

System Macros is a powerful feature that saves you time by turning many keystrokes into few. This article explains how to create System Macros and how to get around the Palmtop's 10 Macro limit on the 100/200LX.

By Mark Scardina

Every time I pull out the HP Palmtop in a group of people, the first words I hear are, "Can you really type on that thing?" An article on page 40 of the Volume 3, Number 6 issue of The HP Palmtop Paper gave some good tips on improving your touch typing speed on the diminutive keyboard. Another practical and immediate solution is to use the HP Palmtops' built-in macro capability to reduce repetitive keystrokes and speed up your use of the built-in applications.

In previous issues Ed Keefe has written some excellent articles on the subject of macros. One of his best, "Living with Big Fingers and an `Itty Bitty' Keyboard" is found on page 44 of the Vol.3, No.1 1994 issue. This month I will look deeper into the Palmtop's built-in macro application, providing a method to attach a specific set of macros to each built-in application.

HP Palmtop System Macros

The System Macros application built into the HP Palmtop provides a way to automate the entry of repetitive commands or keystrokes. A System Macro is simply a recorded sequence of keystrokes that can be activated at any time by pressing the FN key and the F-key to which you have assigned the macro. For example, you can set up a system macro to automatically cut and paste information between two built-in applications, or create a system macro to type your complete name and address at the top of a memo.

After you set up a system macro, you simply press the appropriate (Fn)-F-key combination to execute a string of up to 255 commands or keystrokes.

Creating new system macros

You can create a System Macro by opening up the System Macro application and keying in the macro code. However, the easiest way is simply to record it as you are performing its function. As an example, let's record one that can be used within most applications.

Each of the 100/200LX's built-in applications uses the (F9) key to display the Open File dialogue screen. This screen usually displays the last drive and directory accessed when loading or saving a file in that directory. So, for example, if you press (F9) from the Phone Book, you could get an Open File dialogue box that is set to A:\ as in the following screen.

Open File Dialog Box: Graphic

 Let's say we want to always display the directory that normally contains our data files instead of the directory last used. For this example we'll use C:\DATA\, but you can substitute one of your own.

We'll create a system macro to do this. Since the Open File Function Key is (F9), we'll assign our macro to [Fn]+[F9] to make it easier to remember. Follow these steps:

  1. 1. Activate the key stroke recorder by pressing (<Shift>)-(Fn). Press (F9) to tell it that you want to associate the macro to F9. You should hear a double tone, indicating that the Palmtop is ready to record keystrokes. If you get a single tone and the message that the macro key has already been assigned, press No and try this again with another F-key, or press Yes to overwrite the macro.
  2. 2. Press (F9) to Open, (Fn)-(<LeftArrow>) for Home, C:\DATA\ (ENTER) to enter the path of data files, (<Tab>) to move to the files directory.
  3. 3. Finally, press (<Shift>)-(Fn) (F9) again to stop the recorder.



If you make a mistake while recording a macro, continue on with the proper keystrokes. Once completed you can go back and edit the sequence in System Macros and delete the wrong keys. As long as you use the default extensions when saving files to a built-in application (i.e. .TXT for Memo, .PDB for Phone, etc.), this [FN]+[F9] system macro will always open the File Open dialogue box, go to the C:\DATA directory and move the cursor to the Files window, ready for you to select a file.

Modifying System Macros

Once you've created a macro, you can modify it using the built-in System Macro application. This comes in handy if you want to change a command, or the spelling of a word in a text macro. Press (CTRL)- (&...) to start the System Macro application and displays the following System Macro listing screen. (The contents of the screen will vary, depending on the System Macro's you've already created.)

System Macro List View: Graphic

 To modify a macro from this application, you highlight the macro you want to change, press (F2) to Edit it. You are presented with the following Edit Macro screen:

Edit Macro Screen: Graphic

 You can key in a brief explanation of what the macro does in the Description field, or simply press (<Tab>) to go to the Contents screen, where the macro commands or characters are entered. This is where you modify the content of the macro.

As the list display above indicates, you can create 10 different System Macros, one associated with each Function key. The current (active) set of 10 system macros is stored in the C:\_ DAT\SETUP.ENV file. They can also be saved to a file with the extension .MAC (press (MENU) File Save). Look at the top left of the macro listing screen shown previously and you'll see the filename for my current set of System Macros is 2.MAC.

You can only have 10 system macros saved in any one .MAC file. However, you can use more than one .MAC file to increase the number of system macros available. Groups of 10 System Macros can be stored in individual .MAC files and loaded from the System Macro application by pressing (MENU) File Open. You can also create an individual system macro to automatically load a different .MAC file, a technique we will demonstrate later.

Using multiple sets of system macros

As mentioned before, you can keep multiple sets of up to 10 macros each in separate files with a .MAC extension. To load a different set of 10 system macros into SETUP.ENV, open the System Macro application, press (MENU) File Open, highlight the desired .MAC file and press (ENTER).

We could go through the process of opening the System Macro application and loading a new .MAC file each time we changed applications, but that is time consuming. A simpler and quicker way to accomplish this is to use the process of "chaining" macro files together

The system macro chaining feature lets you run one system macro, which then runs another system macro, which can run still another system macro, and so on. A single system macro is limited to 255 characters or commands. Chaining lets you expand this limit.

More importantly for this article, chaining lets you run a system macro from another .MAC file. The act of the first macro calling up a second macro stored elsewhere automatically loads the .MAC file in which the second macro is stored. This eliminates the need to start the System Macro application and press (MENU) File Open to load the other .MAC file. We can use this feature to attach macros to an application.

Attaching a set of system macros to a specific application

Before we set up our example, it will be useful to review the way we will structure the system macro files.

First we'll create individual .MAC files that will have system macros associated with the particular application (E.G., MEMO.MAC, DATABASE.MAC, APPT.MAC, and NOTETAKR .MAC). Each of these .MAC files will have one system macro that closes the application and reloads MAIN.MAC, the main system macro file.

Then we'll create MAIN.MAC , which will contain macros that will open each application and load the .MAC file associated with the application.

Creating MEMO.MAC

As an example, we'll create MEMO.MAC, the system macro file containing macros associated with the built-in Memo application. We'll key in the macro code directly. Follow these steps.

  1. 1. Open the System Macro application and press (MENU) File New to create a new file.
  2. 2. Highlight Fn+F10 and press (ENTER). (The system macro we associated with Fn+F10 will be the same one we use in each macro file to close the application and load MAIN .MAC.)
  3. 3. Enter Close Memo as your description and press (ENTER) to move to the Contents field.
  4. 4. Key the system macro into the Contents field. It should look like this when it's finished:




The {Menu} Q opens the application's menu and presses Q for quit. The {<c:\_dat\main.mac>Fn+1} is the code that tells the macro to chain to another macro. The first portion of the code, <c:\_dat\main.mac>, tells system macro where to look for the macro (i.e., in the MAIN.MAC file located on the C:\_DAT directory). The Fn+1 tells it which of MAIN.MAC's system macros to run (i.e. Fn+F1).

To create this macro you can use the F6 key to automatically insert a bracketed command. To insert the {menu} command at the beginning of the macro, press (F6), then (MENU), and then Q. To make the "chain to" part of the macro press (F7) and use the "Chain to another macro..." dialogue box, select Fn+1 and press (F10). Then move the cursor in between { and Fn and type in <c:\_dat\main.mac>. If MAIN.MAC already exists, select the file in the dialogue box.

ChainTo Dialog Box : Graphic

 This dialogue box will not let you select a .MAC file that has not yet been created. In addition the chain command must always be the last command in a macro. Keystrokes after it are not allowed. For more on this subject, see "Chaining system macros" in the index of your HP 100/200LX User's Guide.

After you have finished adding the chain portion of the macro, press (F10) and (MENU) File Save As, to save your file as MEMO.MAC. You have nine other system macros available in this file. You can enter other Memo related system macros later.

Use the above instructions to create separate .MAC files for the other built-in applications (APPT .MAC, PHONE.MAC, NOTETAKR .MAC, and DATABASE.MAC). [TIP: When editing the Contents file of a System Macro, you can use the Palmtop's Cut, Copy, or Paste functions to quickly insert sequences.]

WARNING: For this system to function properly, you must remember to close the built-in application with the Fn+F10 macro key. Also if you leave multiple applications open, successive ones will not have their macro files loaded.

Creating MAIN.MAC

From the System Macro application, press (MENU) File New, to create MAIN.MAC. This file will contain macros that open one of the built-in applications and to load its system macro file. Below is a listing of the macros contained in MAIN.MAC. Enter the following macros as described in the previous example.













You can of course include more or fewer applications, or have the .MAC files located in different directories as long as the full path is specified in each chain statement. Remember that the process of chaining involves running a macro in another .MAC file. In all the cases above, the Fn+1 indicates that you are running the Fn+F1 macro in that other .MAC file. If the Fn+F1 macro is left empty, all that happens is the .MAC file gets loaded. But you could have a macro in Fn+F1 that configure the application, takes you to the Open File screen, or something else.

Autoloading a file into a built-in application

You can create a macro to automatically load a commonly used data file. For example, let's say we have two DataBase files, TODOS.GDB and WINE.GDB, that we use on a regular basis. We can create the following system macros that will open the files if you run them from within the DataBase application (Fn+F2 opens TODO.GDB and Fn+F3 opens WINE.GDB):





We can take this technique a step further by incorporating the desired macro at the end of the open DataBase chain command in MAIN.MAC. For example, we could add the following system macro to MAIN.MAC:



Notice that this macro opens DataBase and calls Fn+F2 from DATABASE.MAC, which loads TODO.GDB into DataBase.

From this point you can switch between DataBase .GDB files by simply pressing (Fn)-(F2) or (Fn)-(F3). Additional files can be added to the other keys.

This is only one example of how you can use the Chain function and multiple macro files. Hopefully, it will spark your imagination to come up with some additional ideas. We, at the Palmtop Paper welcome them and will publish the best ones in future issues.