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
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):
| |
Commands take parameters in parentheses, separated by semicolons. Recording a one-page print job produces:
| |
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
| Element | Example | Notes |
|---|---|---|
| Command | Type (memorandum ), Font Size ( 18) | Name, then parameters in parentheses |
| Multiple parameters | Set Tab (Right;No Leader;1.0in ) | Separated by semicolons |
| Comment | ; Do this next | Any line starting with a semicolon |
| Local variable | Var00 … Var01 | Exist only while one macro runs |
| Global variable | GlobalVar01 | Shared by all macros for the session |
| Document variable | (stored with the file) | Saved inside the document |
| Read-only variable | PhysicalPage, LogicalPage, SelectionFlag, FindStatusFlag, BoldFlag, CurrentStyle | Report the program’s state |
| Assignment | Assign (Var01;Var01-1) | Variable, then expression |
| Output a variable | Type Var (Var01) | Types the variable’s value into the document |
| Conditional | If (Var01=1) … Else … End If | != for not-equal, ! for not |
| Loop | Repeat … Until (Var01=0) | Test at the bottom |
| Branching | Label (one), Case (Var01;{1;one;2;two};cancel), Return | Jump to labels by value |
| User input | Pause Until (#Hard Return#), Menu (...), Alert ("...") | Pause for typing, choose from a list, show a message |
| Screen control | Display (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:
| |
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:
| |
A complete small program
This is Rethorst’s “99 Bottles of Beer” macro from 2006, shortened here to the main loop:
| |
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:
| |
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
| Release | Date | Relevance to the macro language |
|---|---|---|
| 1.0 | April 1988 | Macro language and recorder included from launch |
| 1.0.3 | October 1989 | Interim bug-fix release (one of several 1.0.x updates through 1990) |
| 2.0 | January 1991 (Rethorst: 1990) | Redesign following Apple’s interface conventions |
| 2.1 | January 1992 | 2.1.3 (March 1993) includes Grammatik 5 |
| 3.0 | c. October 1993 | Reviewed with AppleScript/Frontier scripting, line-by-line syntax check, three variable scopes |
| 3.1 | September 1994 | First Novell-era release |
| 3.5 | August 1995 | Novell release; base of every later Mac version |
| 3.5.1-3.5.4 | 1996-1997 | Bug-fix releases, mostly from Corel; 3.5.2 reviewed as native on Power Macs |
| 3.5e | October 1997 | Final 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
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