Of WordStar Macros

Almost all major word processing programs can run a set of user defined instructions called macros. They are very useful in avoiding repetitive tasks like typing of date lines for each story. Use them as frequently as you can when your work is repetitive. They even help you in avoiding typos that may invariably occur when typing long place names like Thiruvananthapuram.

Here are some excerpts from the Handbook for Journalists, written by Roy Mathew  and published by the Press Club, Thiruvananthapuram (see belated review), on how to code a WordStar (Version 6) macro for generating a dateline by nesting of two macros.

The keystrokes shown with the caret sign (^) are control characters, to be produced by keeping the Control key down while keying in the character key. In WorldStar macro dialog box, it is be generated by pressing Control-P (^P) first and then the required Control key combination..

The macros

The macro function is one of the most useful feature of word processing programmes. This function allows you to store a string of characters including commands and call them back into action with a two stroke commands (in WordStar versions 4-6).

The macros are assessed by pressing the Esc key from the edit screen. This brings up the Shorthand Menu. Below the Menu box, the screen will show a brief description of the macro against each character used as a shorthand. To execute a macro, you press key corresponding to one of the characters listed. (To return to the edit screen without executing a macro, press the space bar).

Writing your own macros

Now to write a macro of your own. As stated earlier, macros can hold not only commands but text also. So it is not necessary for you to type in a cumbersome word like THIRUVANANTHAPURAM every time minding the spelling. Just define a macro key as THIRUVANANTHAPURAM and presto! you will have the word inserted into your text every time you execute the macro.

For easy recollection, it will be convenient to define THIRUVANANTHAPURAM against the letter T. To do so press Esc followed by ?. At the dialog box, enter the letter T as the shorthand character. If a macro has been already defined for the letter, the box will show the short hand character, its description and definition. Else the lines will be blank. Whatever be the position, you can go ahead with defining a new macro for the key.

In the first line, where the cursor will be, enter any brief description of the macro. This could be anything of your choice like TVM or THIRUVANANTHAPURAM itself. Press Return. In the second line enter THIRUVANANTHAPURAM in full and press return. You will be back on the original dialog box.  Press a key if you want to define another macro. Else press Return. WordStar will ask whether you want to store the macro to disk. Answer Yes if you want the macro to be executable when you load the program the next time. (WordStar saves the macros under the file name WSSHORT.OVR which is read when loading the program).

Now test the macro by pressing EscT. The word THIRUVANANTHAPURAM will appear at the cursor. If you want a space after the word, you can add that too and the Shorthand display will indicate the space with a small dot. Try defining small macros for abbreviations like Rs. and Mrs. Include a space at the end of those definitions as it is a typographical requirement. Some writers by habit fail to add these spaces. So learn to use the macros and your typesetter will thank you for that.

Creating the dateline

WordStar comes with preset macros for date and time and how these would be displayed will depend on the default setting. The usual format is January 1, 1994 (Mddyyyy). However, it is possible to customise the display format in different ways. The choices include those for elimination of the year and for abbreviating the month name. However, newspapers like THE HINDU follows the practice of abbreviating the longer month names while leaving the shorter ones as such. WordStar can be customised to give only one of these formats at a time. So the simpler method is to have separate macros for the different outputs needed.

The key for the date macro is @. Press Esc followed by @ and the date will appear on the edit screen. It is assumed in the forgoing discussion that WordStar is set to display the date in full in the January 1, 1994 format.

Now to write the macro for the dateline, Press Esc? and enter the key, say D, at the dialog box. In the first line type in a description of the macro, say, dateline.

In the second column enter the following the commands to have the date line displayed as BANGALORE, April 1.


This macro invokes another macro from within. This is called nesting. The ^[ here stands for the Escape key. After the place name the ^[@ shorthand command inputs the date. The cursor is located at the end of the dateline. ^A moves the cursor backwards by one word to the beginning of the figure showing the year. ^T deletes the year. The ^Hs delete the space and comma before it and adds a period. If you want to move to the next line, you can add a ^M. You may add a space if you propose to continue writing on the same line.

However, as stated earlier it is not possible to enter the control characters directly on to the second line of the dialog box. So the actual sequence to be entered on the line is as follows.


This will appear on the Shorthand screen as:


You may add your name before the date line separated by a Return as follows.

From T. V. R. Shenoy^MNEW DELHI, ^[@^A^T^H^H.^M

This macro will generate the name and dateline as follows and place the cursor on the third line.

From T. V. R. Shenoy
NEW DELHI, June 6.

The following macro will abbreviate the month name retaining the initial three letters. (This macro will function accurately only if the WordStar is in insert mode).

Bombay, ^[@^A^A^A^D^D^D. ^T^F^H^H.^T^M

The output will be as:

Bombay, Aug. 6.

If you want to abbreviate to four letters as in Sept., add one more ^D to the macro, next to the other three.

If you want the whole dateline in caps, you may add the following commands before ^M. Control-M can be omitted in you do not want to move to a new line.

WordStar Version 7

In WordStar 7 and newer word processing programs, you can record a macro by keying in the characters and issuing the commands needed in a sequence. To create, the date line, for example, issue the command to start recording (^MR in WordStar Version 7). Then, start typing the dateline, invoke the built in functions to generate the current date in the appropriate format, edit it if necessary, using the word processing commands and stop recording. When you invoke the saved macro, everything you did will be repeated.
A WordStar 7 marco will for creating a dateline marco will be recorded as a .WSM file as follows. It can be edited with attention to the syntax.

Sub Main
    Key("By Our Special Correspondent{Enter}")
    Key("thiruvananthapuram, {Ctrl+M}@{Ctrl+K}k{Ctrl+Q}s{Ctrl+K}b{Ctrl+K}""{Ctrl+K}{Ctrl+H}")
End Sub

Cyber Resources for Journalists