Est. 1988 Beginner

Macintosh WordPerfect

The macro language of WordPerfect for the Macintosh (1988-1997): record your keystrokes and menu choices, then open the script and add variables, loops, branches, dialogs and AppleScript calls

Created by WordPerfect Corporation of Orem, Utah (Macintosh development group; Kevin McCoy is named by Edward Mendelson as one of the original programmers). Novell owned the product from 1994 and Corel from 1996

Paradigm Procedural command scripting: a macro is a list of named WordPerfect commands with parenthesised, semicolon-separated parameters, plus If/Else/End If, Repeat/Until, Label/Case/Return branching and user dialogs
Typing Untyped in practice: numbered read/write variables (Var00, GlobalVar01...) hold numbers or text, and read-only system variables such as PhysicalPage or SelectionFlag report the program's state
First Appeared 1988
Latest Version WordPerfect 3.5e (Enhancement Pack), October 1997, with Corel's March 1998 updater patch

Macintosh WordPerfect is the macro language built into WordPerfect for the Macintosh, the Mac edition of the leading DOS word processor. The program shipped in April 1988 and was updated until Corel’s 3.5e in 1997. You could record a macro by doing the work while the program watched, and the recording came out as a readable list of named commands. You could then open that list in a macro window and add variables, loops, conditional branches, dialogs and pauses for typed input. By the 3.x releases the language had, in the words of John Rethorst’s guide, “over 900 commands and objects”, and it could also exchange data with AppleScript. For a Mac office user, it was a way into programming that started from work they already knew how to do by hand.

History & Origins

A late arrival on the Mac

In the mid-1980s WordPerfect Corporation of Orem, Utah, owned the DOS word processing market. It was much slower getting onto the Macintosh. Pete Peterson, the company’s executive vice-president, wrote later that they had “started out so far behind on the Mac” that they finished an Apple II version first, and that by the time the Mac version shipped in 1988, Microsoft Word for the Mac had “a four year head start”.

The Mac version was announced for May 1987 and missed that date by almost a year. Peterson recalls the Mac developers at the 1987 Christmas party wearing grocery bags over their heads and singing “Waiting for the Macintosh to Ship” to the tune of “Walking in a Winter Wonderland”. In March 1988, with the product still unfinished, he sold it anyway at MacWorld: for $99, buyers got a buggy pre-release copy he called “Betaware” and a promise of the final one.

Release 1.0

WordPerfect 1.0 for the Macintosh shipped on 4 April 1988. Edward Mendelson’s chronology records that the first copies, dated 5 April, were recalled and replaced with copies dated 26 April. More than 20,000 copies shipped in the first month. The reviews were cool. Peterson admits most reviewers felt the program was “patterned too closely after our PC product”, and even users who wanted compatibility with the PC version were disappointed that it used the old DOS 4.1 file format.

Macros were there from the beginning. Macworld’s review of 1.0 said “WordPerfect’s macro language handles very sophisticated operations like mail merge, or trivial tasks like reassigning ⌘-key combinations”, and that users “tentative about writing macros can have the program record a series of mouse and keyboard actions”. The surviving sources don’t say whether that first language used the same command syntax as the later releases described below.

Version 2 and version 3

Version 2 was a redesign that followed Apple’s interface conventions much more closely. Mendelson dates WordPerfect 2.0 for the Macintosh to 14 January 1991, and Rethorst remembers it as a 1990 release. Version 2.1 followed in January 1992. Version 3.0, released around October 1993, added tables, Button Bars, an equation editor and built-in Grammatik. TidBITS’s December 1993 review described the macro system in detail, praised it highly, and noted that the program could also be scripted from AppleScript and UserLand Frontier.

Novell, Corel and the end

Novell bought WordPerfect Corporation in 1994 and released version 3.1 that September and 3.5 in August 1995. Corel bought WordPerfect from Novell in January 1996 and issued a series of bug-fix releases numbered up to 3.5.4. Sources differ on who shipped 3.5.1: TidBITS calls it Corel’s first update, while Mendelson lists it as the last Novell version. The last version was the WordPerfect 3.5 Enhancement Pack, or 3.5e, sold on CD from October 1997. According to Mendelson it had been planned as version 4.0. Corel patched it in March 1998, then in August 1999 made the patched program a free download. It withdrew the download in 2001.

Design Philosophy

The language is built around one idea: anything you can do in WordPerfect, a macro can do, and you can see how it did it. The recorder doesn’t store raw keystrokes or screen positions. It stores the WordPerfect command that each action triggered. Pressing Return records Hard Return. Typing records Type (...). Choosing a print range records the full Print Options command with every setting written out. So a recording reads like a description of what you did, and you can edit it.

This makes record-then-edit the normal way of working. TidBITS reviewer David Reiser described it in 1993: “I almost always have the macro recorder create as much of an operation as I can do manually; then I go to the macro edit window and add loops, conditional branches, keyboard input prompts, and so on.” Rethorst’s guide teaches it the same way. You can even keep the macro window and the document window open together, recording in one and typing commands in the other.

Two more design choices stand out:

  • Immediate syntax feedback. When you press Return after a line in the macro editor, a valid command turns bold. If the line is invalid, the first bad part is underlined. If you try to save a macro that contains an error, an alert appears.
  • Macros as library resources. Macros are stored in WordPerfect’s Library, or inside an individual document, where they override Library macros with the same name. They can also be shared from a Common Library on a network, alongside styles and Button Bar layouts.

Key Features

Recorded commands

Rethorst’s first exercise records a letter closing. Opened in the macro editor, it reads (with the nine Tab lines shortened here):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
Hard Return
Hard Return
Tab
Tab
Type (Sincerely,)
Hard Return
Hard Return
Hard Return
Hard Return
Tab
Tab
Type (Charles Babbage )

Commands take parameters in parentheses, separated by semicolons. Recording a one-page print job produces:

1
2
Print Options ( 1;1;1;Document;Every Page;Forward;Print Overlay )
Print (Document )

If you replace the first two 1s with the read-only variable PhysicalPage, the macro prints whichever page the insertion point is on, without opening the Print dialog.

Syntax at a glance

ElementExampleNotes
CommandType (memorandum ), Font Size ( 18)Name, then parameters in parentheses
Multiple parametersSet Tab (Right;No Leader;1.0in )Separated by semicolons
Comment; Do this nextAny line starting with a semicolon
Local variableVar00 … Var01Exist only while one macro runs
Global variableGlobalVar01Shared by all macros for the session
Document variable(stored with the file)Saved inside the document
Read-only variablePhysicalPage, LogicalPage, SelectionFlag, FindStatusFlag, BoldFlag, CurrentStyleReport the program’s state
AssignmentAssign (Var01;Var01-1)Variable, then expression
Output a variableType Var (Var01)Types the variable’s value into the document
ConditionalIf (Var01=1) … Else … End If!= for not-equal, ! for not
LoopRepeat … Until (Var01=0)Test at the bottom
BranchingLabel (one), Case (Var01;{1;one;2;two};cancel), ReturnJump to labels by value
User inputPause Until (#Hard Return#), Menu (...), Alert ("...")Pause for typing, choose from a list, show a message
Screen controlDisplay (Off) … Display (On)Turn off redraw for speed

Rethorst points out one difference from AppleScript: WordPerfect’s read/write variables are numbered rather than named, and they “come pre-initialized to the equivalent of "” or zero".

Pauses and dialogs

A macro can stop partway and wait for the user. Rethorst’s memo macro builds a formatted header, then waits with Pause Until (#Hard Return#) at the “To:” and “Subject:” fields. You type the addressee, press Return, and the macro carries on. For choices there is Menu. Here is part of WordPerfect’s own Multiclip macro, which gives you ten text clipboards:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
If (SelectionFlag)
Copy
Menu (Var01;"Which Clipboard?";
{"one";"two";"three";"four";"five";"six";"seven";"eight";"nine";"zero"} )
;
Case (Var01;{1;one;2;two;3;three;4;four;5;five;6;six;7;seven;8;eight;
9;nine;10;zero};cancel )
Else
Alert ("You must have text selected for this macro to work." )
End If
Label (cancel)
Return
;
Label (one)
Assign (GlobalVar01 ;Clipboard)
Return

Each clipboard is a global variable, and global variables can be assigned keystrokes in the keyboard preferences. Pressing the keystroke types the stored text.

Loops over a document

The language is at its best when walking through a long document. This is the core of the macro Rethorst used to index his 700-page book. It finds each bold passage, copies it, and writes it with its page number into a second window:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
Display (Off )
Repeat
Find Next Code (Forward;Bold On)
Right (Select)
;
Repeat
Raw Read (function;Right )
Until (!BoldFlag)
Copy
Right ()
Assign (Var00 ;LogicalPage)
Select Window (NextWindow)
Paste
Tab
Type Var (Var00)
Hard Return
Select Window (NextWindow)
;
Until (!FindStatusFlag)
Display (On)

A complete small program

This is Rethorst’s “99 Bottles of Beer” macro from 2006, shortened here to the main loop:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
New Document
Assign (Var01;99)
Repeat
Type Var (Var01)
If (Var01=1)
Type ( bottle of beer on the wall, )
Else
Type ( bottles of beer on the wall, )
End If
Type Var (Var01)
If (Var01=1)
Type ( bottle of beer,)
Else
Type ( bottles of beer,)
End If
Hard Return
Type (Take one down and pass it around, )
Assign (Var01;Var01-1)
If (Var01!=0)
Type Var (Var01)
Else
Type (No more)
End If
If (Var01=1)
Type ( bottle of beer on the wall.)
Else
Type ( bottles of beer on the wall.)
End If
Hard Return
Hard Return
Until (Var01=0)
Beep
Alert ("Buy more beer!")

Graphics macros

Macros also work in WordPerfect’s built-in drawing editor. A shape drawn during recording becomes a script that you can adjust to exact positions, and graphics macros can pause for input like any other. Rethorst argued that this made WordPerfect “the only graphics program for the Macintosh with full-fledged scripting”, meaning command scripts rather than stored drawings. That is one author’s claim, not a survey.

AppleScript integration

By version 3.0, WordPerfect supported the Apple event Required and Core suites and could be driven by AppleScript or Frontier. The two languages work together. An AppleScript can run a WordPerfect macro with Do Script and pass it up to 50 variables, and a WordPerfect macro can run an AppleScript:

1
2
3
4
5
tell application "WordPerfect"
    make new window
    activate
    Do Script "memo"
end tell

Macros can also be saved as plain text with Save Text, for sharing or long edits, and turned back into macros with Read Text, which parses them again.

Evolution

ReleaseDateRelevance to the macro language
1.0April 1988Macro language and recorder included from launch
1.0.3October 1989Interim bug-fix release (one of several 1.0.x updates through 1990)
2.0January 1991 (Rethorst: 1990)Redesign following Apple’s interface conventions
2.1January 19922.1.3 (March 1993) includes Grammatik 5
3.0c. October 1993Reviewed with AppleScript/Frontier scripting, line-by-line syntax check, three variable scopes
3.1September 1994First Novell-era release
3.5August 1995Novell release; base of every later Mac version
3.5.1-3.5.41996-1997Bug-fix releases, mostly from Corel; 3.5.2 reviewed as native on Power Macs
3.5eOctober 1997Final release; updater patch March 1998; free download 1999-2001

The Macintosh version numbers have nothing to do with the DOS and Windows numbering. A Wikipedia note observes that 3.5e could exchange files with WordPerfect 7 for Windows 95 despite its lower number.

Current Relevance

The language is historical. Nothing has been released since 3.5e, Corel withdrew the free download in 2001, and WordPerfect is now sold only for Windows. The program still runs, with limits. Mendelson’s guide documents running it in the Classic environment on PowerPC Macs up to Mac OS X 10.4, but not on 10.5 or on any Intel Mac. Rethorst’s guide covers running it in the SheepShaver emulator, and his 2014 second edition was produced “using only WordPerfect 3.5e”. He also distributes a 185-page WordPerfect Scripting Guide and a 140-page collection of tips and macros through the WPMac user group. There is no Docker image and no reimplementation of the language.

The language still matters to archivists, because a WordPerfect for Mac document can carry its own macros, styles and document variables, not just text. The file formats have their own PRONOM identifiers (for 2.x, 3.x and 3.5 documents), and the Library of Congress notes that a WordPerfect 3.0/4.0 Mac file embeds a Macintosh resource fork in its header.

Why It Matters

Macintosh WordPerfect took a different approach from the keystroke-oriented macros of the DOS versions of its day. A recorded keystroke only means something as long as the keys keep their meaning, and it maps poorly onto a mouse-driven screen. The Mac language recorded commands: Hard Return, Font Size ( 18), Print Options (...). Those mean the same thing whatever the screen looks like, and they read like a description of the work. On top of that came real programming tools: variables at three scopes, Repeat/Until, If/Else, labels, dialogs, and two-way AppleScript calls.

It never had the audience of Word’s macros on the Mac, because WordPerfect never won the Mac market. Peterson wrote that WordPerfect eventually captured only about ten percent of the Macintosh word processing market. But its users wrote real software in it, such as clipboard managers, document generators and indexers for whole books, and the record-then-edit approach let them start from work they already knew how to do by hand.

Timeline

1987
WordPerfect Corporation announces a Macintosh version for May 1987; it misses that date and the end of the year, and at the Christmas party the Mac developers sing 'Waiting for the Macintosh to Ship'
1988
After a $99 'Betaware' pre-release sale at MacWorld in March, WordPerfect 1.0 for the Macintosh ships on 4 April with a macro language and a macro recorder; more than 20,000 copies go out in the first month
1991
WordPerfect 2.0 for the Macintosh, dated 14 January 1991 in Edward Mendelson's chronology, is a redesign that follows Apple's interface conventions much more closely
1993
WordPerfect 3.0 adds tables, Button Bars and an equation editor; TidBITS reports it scriptable from AppleScript and Frontier, with a macro editor that checks each line's syntax as you type it
1994
Novell buys WordPerfect Corporation; WordPerfect 3.1 for the Macintosh follows in September
1995
Novell releases WordPerfect 3.5 for the Macintosh in August
1996
Corel buys WordPerfect from Novell in January; by December it has shipped bug-fix release 3.5.2, which TidBITS reviews as native on Power Macs and AppleScript-scriptable (sources differ on whether 3.5.1 came from Novell or Corel)
1997
Corel ships the WordPerfect 3.5 Enhancement Pack (3.5e) on CD in October; originally planned as version 4.0, it is the last Macintosh release
1999
Corel posts 3.5e, with its March 1998 updater patch built in, as a free download in August; it is withdrawn in 2001
2014
John Rethorst releases a free second edition of 'Teach Yourself WordPerfect Mac', produced entirely in WordPerfect 3.5e, with its table of contents and index built by macros

Notable Uses & Legacy

Teach Yourself WordPerfect Mac, second edition

John Rethorst built the 700-page book's table of contents with a macro that walked every heading style and marked TOC levels, and its index with a macro that copied every bold phrase and its page number into a second window

Bundled macros: Multiclip, Emboss, Database <-> Merge File

WordPerfect shipped macros that added features the menus lacked: Multiclip gave ten named text clipboards through a Menu dialog and global variables, and Database <-> Merge File turned tab-delimited database exports into merge data

Office document automation

TidBITS reviewer David Reiser described a memo macro that saved the author's name in a document variable, so a later signature-line macro could fill it in when he or his secretary finished the memo

Qualitative research data handling

Rethorst's book describes how a Cornell team led by Dalva Hedlund coded interview transcripts in WordPerfect so that Find and macros could gather every segment carrying a given topic code into a new file

99 Bottles of Beer catalogue (entry 1139)

Rethorst's 2006 '99 Bottles of Beer' macro, which uses Assign, Repeat/Until, If/Else and Type Var, is the catalogue entry this encyclopedia's 'Macintosh WordPerfect' name comes from

Running Today

Run examples using the official Docker image:

docker pull
Last updated: