home *** CD-ROM | disk | FTP | other *** search
-
-
- In this issue of AMnews...
-
- WordPerfect's MacroEditor Means
- Escape From Drudgery
-
- by Randy Chase and Grant Johnson
-
-
- One of the key words in our relationship with computers is repeat. While
- we tire of repetition quickly, the computer thrives on it. What is needed
- in repetitive situations is some way for you to tell the computer what do
- and when -- in short, a macro.
-
- Macros let you condense a series of keyboard activities or mouse moves
- into a self-contained package of instructions that can be easily called up
- in the future. When invoked, a macro can guide the program through the
- required steps to produce the desired results.
-
- Macro Magic
-
- The task at hand need not be large and unwieldy to justify making a
- macro of it. A small but repetitive task can be effectively controlled by
- one, such as changing the directory path to a frequently accessed
- sub-directory, or altering the margins in a WordPerfect document to those
- you use on a regular basis.
-
- Something as simple as starting a letter is perhaps one of the most
- effective (and practical) utilizations of a macro. Every time you begin a
- letter, yo probably follow the same series of steps. What margin settings
- are required? What is the date? What return address (or letterhead) is
- needed? These questions can be answered once in a macro, instead of
- tediously repeated every time you write a letter. Once embodied in a
- macro, these frequently repeated tasks can be accomplished with a few
- simple keystrokes.
-
- WordPerfect itself supports the creation of macros in the most natural
- manner possible -- imitation -- by simply telling the computer to pay
- attention while the task is being performed. Then, when required, it can
- repeat that process automatically.
-
- Enter Macro Editor
-
- While WordPerfect offers this simple means of defining macros, making
- even the smallest changes in them has (until the release of WordPerfect's
- Macro Editor in this issue of AMnews) necessitated that you start over from
- the top. That's because WordPerfect's word processing program of the same
- name records everything you do when it "records" a macro, mistakes and all.
- If you misspell a word and corrected, every time that macro runs you'll
- have to watch it corrected over and over.
-
- Also, should even the slightest modification be needed in order for it to
- perform, the entire macro had to be redefined. In the case of complex
- macros, this required starting over from the beginning, slowly and
- precisely re-creating the entire macro, without making any errors while
- incorporating the desired changes.
-
- Inside the Workbench Programs Drawer on the AMnews_1 disk, you'll find a
- drawer containing the Macro Editor which is called ME, a number of
- supporting files including Help, and eleven pre-programmed macros.
- Although the Macro Editor won't run inside of AMnews due to the absence of
- the proprietary WordPerfect file it requires, Figure #1 from Thingies on
- the Articles Jazz pull down menu at the top of this screen will show you
- what it looks like on Workbench.
-
- The release of Macro Editor provides the solution to this awkward
- situation. By using it, WordPerfect owners can now take those
- not-quite-right macros and perfect or adapt them with great precision, not
- to mention ease. This increased flexibility makes using macros within
- WordPerfect far more inviting and should encourage you to explore the
- untapped potential of creating your own personal command structure.
-
- If It's Worth Doing Twice...
-
- The secret to streamlining WordPerfect and customizing its daily operation
- lies in determining just what can best be done within macros. If you do
- something likely to be repeated again in the future, it might as well be
- done the first time with WordPerfect's macro recorder turned on, capturing
- the activity in a macro that can then repeat the process whenever needed.
-
- With the greatly increased flexibility offered by Macro Editor, more
- intricate applications can now be more comfortably mastered, modified and
- adapted as needed in the future. It's no longer necessary to watch
- mistakes made and corrected while defining a macro be repeated every time
- the macro is invoked. With the Editor, it is now a simple process to
- delete the incorrect command lines and insert new ones in their place.
-
- Description of Sample Macros
-
- Agreement.mac - This loads a sample rental contract into WordPerfect, and
- allows you to fill in the appropriate information needed. At its
- conclusion, it invokes a second macro, letterhead.mac, that inserts a
- simple letterhead at the top of the document.
-
- Letterhead.mac - Used by agreement.mac, this provides a centered business
- heading for the rental contract created by agreement.mac.
-
- Documentize.mac - This macro, written by WordPerfect's Mike Scalora, will
- try to convert a AMiga text file (with hard returns at the end of each
- line) into a WordPerfect document (hard returns only at the end of
- paragraphs). To use the Documentize macro, RETRIEVE your text with the
- TEXT FILE sub-menu, then execute this macro. For it to work properly, you
- must have a blank line (a line with nothing on it, not even blanks) between
- each paragraph.
-
- Fancy.LH.mac - This is an example of a macro to begin a letter by placing
- the letterhead information at the top of the document, insert the current
- date, provide a macro pause letting youinsert the inside address, and then
- begin the salutation with "Dear" before returning control.
-
- Letter.Close.mac - A companion macro to Fancy.LH.mac, this closes the
- letter begun in the preceding macro.
-
- Change.Dir.mac - While this is a simple thing, it's a good example of how
- common routines can be streamlined by utilizing macros. This changes the
- active path to a sub-directory on df1: named text. If documents are saved
- in various directories on the disk, the tedious process of going through
- the requestors to access the desired files can be assumed by the macro
- rather than by you. If used enough, this macro might be more effectively
- defined as a one-key macro to further streamline the process.
-
- Index.mac - By combining the search and mark-text features within
- WordPerfect, this macro facilitates the creation of an index for an
- article. To use this macro, first do a forward search (the F2) for the
- word you wish to index. This search defines for the macro what word it
- will be indexing. When the macro has completed the search and marked all
- of the word's appearances in the document, the process can be repeated
- until all desired words have been indexed. Follow the instructions in your
- WordPerfect manual for the formal creation of the index itself.
-
- Begin.mac - This macro is called up by the Indexing macro to return the
- cursor to the beginning of the document before starting the search and mark
- operation of the indexing process.
-
- PhonePrint.mac - This is a macro for NoteBook (from WordPerfect's Library).
- It opens a file called PhoneBook and prints out a listing of the names and
- phone numbers contained there. Before using it, it will need to be loaded
- into Macro Editor and the name of the file to be opened and printed changed
- from PhoneBook to the appropriate name requested.
-
- MacMover.mac - This is an example of the use of a macro to copy desired
- macros from an old data disk to a new one. It requires a formatted data
- disk in drive df0: and the old data disk with the Macs directory in drive
- DF1:. Since the files being copied are selected by typing the file name
- rather than clicking on files with the mouse, it will be necessary to use
- the editor to insert the names of the proper macros that you wish to
- transfer to the new data disk.
-
- Letterhead.mac - This macro creates a simple letterhead and is included as
- an example of a chained macro. The macro Agreement.mac calls this macro
- up. (This chaining of macros also provides an example of the logic and
- sequence of execution of chained macros. Since the initial macro must
- complete its full sequence of events before it will surrender control to
- the next macro, it is necessary to complete the rental control prior to
- summoning the letterhead macro which then returns to the top of the
- document and inserts the letterhead at the top of the page.)
-
- Amiga D - This one-key macro reads the date and inserts into the document
- at the current cursor location. As with all one-key macros, it is
- necessary that it be located in the root directory on your WordPerfect
- disk.
-
- Amiga S - This macro tells WordPerfect to activate the speller and check
- the entire document.
-
- Amiga W - This is a simple but often time-saving use of a macro to insert
- a frequently typed character string into a document. In this case the
- macro types WordPerfect.
-
- Be cautioned that these sample macros are designed to show some of the
- uses of macros, and to provide examples to experiment with using the
- Editor. They all have been created assuming that they will reside on DF1:
- in a directory named MACS. Prior to using them, they should be loaded into
- the Editor and modified to indicate where the user has them stored.
- Installing the Editor
-
- The WordPerfect Macro Editor contained in this issue of AMnews requires
- access to the WP.Library file on your WordPerfect program disk. It must
- therefore be installed on your WordPerfect disk before you can use it.
- This can be done using either the CLI or from WorkBench by dragging the
- icons over to your disk.
-
- To properly install the Macro Editor using the CLI, it is necessary to
- copy the following files to your WordPerfect program disk: ME, ME.info,
- Help.Me and Help.Me.info. If you wish to use the sample macros included
- with this article, it will also be necessary to move the contents of the
- MACS directory to your disk. Although you can make yours work from
- wherever you like, these macros are designed to be used from df1:MACS.
- Should you wish you to locate them elsewhere, they will need to be edited.
-
- If you wish to use the Macro Editor without running WordPerfect, you will
- have to put the WP.Library file on the LIBS directory of the Workbench disk
- you "boot" your system with. For those using ARP as an alternative to the
- standard AMiga Workbench, the Macro Editor is compatible and will utilize
- the appropriate ARP libraries; however, WP.Library must still be present in
- the LIBS directory of the active Workbench disk.
- Macro Editor Commands and Options
-
- OPEN: loads and existing macro from disk into the editor.
-
- SAVE: saves the macro being edited under same name.
-
- SAVE AS: allows the macro being edited to be saved under a new
- name.
-
- DELETE: deletes the high-lighted line in macro currently loaded
- in editor.
-
- INS KEY: selects the "Insert Key" mode, which allows keystrokes
- to be inserted into a macro.
-
- INS ITEM: provides a list of items (and activities/events) that are
- unavailable from the keyboard, but can be inserted into a macro by simply
- clicking on the desired item. Items include macro delays and pauses, mouse
- movements, button activity, zoomgadgets, scrolling, and moving and sizing
- of windows.
-
- EDIT: the edit menu option allows modification of the five macro items
- that have parameters:
-
- 1) Button Up
- 2) Button Down
- 3) Mouse Move
- 4) Window Size/Move
- 5) Zoom Gadget
-
- To edit these items, simply move the cursor to the macro line containing
- the event, and with it highlighted, click on the edit key. A requester
- will appear offering prompts for new screen locations to be entered. For
- instance, when editing a move/re-size window command, the editor will
- provide a requestor that allows for editing both the X and Y positions, as
- well as the width and height of the window.
-
- Item/Count: At the bottom of the Editor screen, the Count number shows the
- total number of times a particular line is contained in the macro currently
- in the Editor. The Item number shows the relative number of the currently
- highlighted line within the macro being edited.
-
- Pull Down Options
-
- The project menu options provide mouse-driven menus to open a macro for
- editing, saving, and creating a new CLI. All options here perform the same
- as they do within WordPerfect.
-
- The Type options are used to designate the kind of macro being edited.
- The Editor can be used on macros written for WordPerfect, Notebook and
- P-Edit, however it is imperative that you select the proper macro type by
- using the pull-down menu and selecting the appropriate setting. Editing
- the wrong macro with the wrong type setting will produce very unpredictable
- and undesirable results.
-
- The print options in the menu bar provide for the printing of the macro
- currently in the Editor as a text file. (For an example of the printed
- output, see the macro listings that accompany this article.) The printer
- control command turns on the WordPerfect printer control screen.
-
- The help features of the Macro Editor can be accessed either via the help
- key or the menu option provided for the mouse.
-
- When in the help mode, pressing any letter on the keyboard will provide
- an alphabetical listing of features that start with that letter, along with
- the key stroke required to access that option. That key can then be
- pressed to obtain a description of how the feature works.
-
- Function Key Commands
-
- F1 - Cancel Key: this key cancels the operation of any function. This key
- will also UNDO the last delete if the is no function in progress.
-
- F7 - Exit: exits you from the Macro Editor. If the macro has been
- modified you are asked if you want to save it. The ARP file requester will
- be used if the arp.library is available.
-
- F9 - Save: saves the macro currently in the Editor. If the file has been
- saved previously, it will be saved using the same file name. If not, a
- prompt will appear asking for a file name. In order to save the edited file
- under a different name, it is necessary to use the Save As option, accessed
- by either clicking on the Save As gadget, or by pressing F10.
-
- F10 - Save As: use the Save As feature to save an edited file under a
- different name or using a different directory path. A prompter will
- appear, requesting the desired path and file name prior to saving the
- macro. (The ARP file requester will be used if the arp.library is being
- used as an alternative to the standard Amiga Work Bench.)
-
- Shift F3 - Switch: switches control from the Macro Editor macro to
- WordPerfect, NoteBook or P-Edit, should one of them be running in the
- background.
-
- Shift F7 - Print: prints the macro being edited using the WordPerfect
- Print program.
-
- Shift F9 - Open: clears the macro being edited and prompts for the file
- name of a new macro to edit. (Again, the ARP file requester will be used
- if the arp.library is being used.)
-
- Shift F10 - Retrieve File: retrieves a macro from disk and copies it into
- the Macro Editor window for editing. The document to be retrieved is
- inserted at the current position of the cursor on the screen without
- deleting any of the text you might currently be working on. This command
- makes it possible to combine or append macros.
-
- Alt F9 - New: clears the current macro and leaves the Macro Editor window
- empty. If the macro in the editor has been modified since it was last
- saved, a requester will ask if the file should be saved before clearing the
- work window.
-
- Ctrl F1 - New CLI: opens a new Cli window, while leaving the Editor in the
- background.
-
- Ctrl F7 - Printer Control: opens the Printer control panel from Word
- Perfect. Consult your Word Perfect Manual for further instructions.
-
- Ctrl F9 - Clear: clears the current macro and leaves a blank document in
- the Editor. Like the New command, if the resident macro has been modified
- since it was last save, a requestor will provide the option to save the
- edited version before clearing the Editor.
-
- Delete: deletes the line item highlighted under the cursor and places it
- in the undo buffer. Cancel can then be used to reinsert the item into the
- macro.
-
- One Key Macros
-
- The most effective way to access frequently used macros within
- WordPerfect is through the definition of one-key macros. These are macros
- that can be invoked by simply holding down either one of the Amiga keys and
- then pressing another key.
-
- When WordPerfect added the use of the standardized keys defined by
- Commodore for the AMiga (i.e. Amiga-S saves, Amiga-C copies text etc.) they
- also provided for the optional alternative use of these keys. By changing
- the definitions in the Character Mapping screen from AMiga to macro (by
- clicking on the first character of the definition and pressing the 1 key)
- they can then be defined as one-key macros.
-
- A one-key macro is created the same as any other macro, only when
- prompted for the macro name, instead hold down the AMiga key and press the
- key that will invoke the macro. These one-key macros are automatically
- saved to the WordPerfect disk (or the hard drive directory where
- WordPerfect is assigned). They can be edited and modified normally.
-
- To load a one-key macro into the Editor, it is necessary to load them by
- the correct file name, which is automatically assigned by WordPerfect at
- the time the macro is defined. These macros can be found on the directory
- by looking at the files named {WPL}___.AMGX where X is the alpha key
- assigned to that macro. For instance, {WPL}___.AMGS would be the macro
- invoked by holding down the AMiga key and pressing S.
-
- A word of caution: once the standardized Amiga editing keys have been
- redefined as personalized macros, it will be necessary to re-install
- WordPerfect in order to again use those editing keys. It is possible to
- use the unused keys for macros and still retain the AMiga editing keys.
-
- Philosophy of Use
-
- Macro Editor is designed to increase the efficiency of defined macros,
- not to act as an alternative means of creating them. The only recommended
- way to create a WordPerfect macro is within WordPerfect! Now, however, the
- Editor will allow modification and editing of the macro, once it has been
- created.
-
- When creating macros in WordPerfect, it is always best to use the
- keyboard command structure whenever possible rather than mouse activities.
- There are a variety of situations in which mouse moves can create problems
- within a macro. A classic example is that of a mouse click within a macro
- that addresses a precise spot on the screen. The potential for problems
- lies in the fact that the macro may later be executed with different
- Preferences screen settings that could shift the screen a few pixels to the
- left or right. Suddenly that mouse click is no longer happening on the
- same screen location as it was when the macro was created!
-
- When editing macros it is important that you be aware of the
- keyboard-invoked menu structure of WordPerfect. If the macro invoked by
- the Amiga S key is loaded into the Editor (found in the MACS directory
- under the name {WPL}___>AMGS), it will show the Spell command, followed by
- the numeral 3 on the second command line. If the Spell menu is entered by
- pressing CTRL F2, the third option listed is "3. Document". When editing
- macros, it is necessary to be familiar with these menus in order to alter
- the activity originally defined within the macro. Since Macro Editor can
- run in the background with WordPerfect, it is easy to jump back into the
- program to check references to menu structures whenever necessary.
-
- Another danger with mouse activity within a macro is a potential problem
- of dialogue boxes that are opened but are not visible on the screen. When
- a macro is invoked only to have WordPerfect seem to lock up or freeze, it
- is most commonly the result of an invisible dialogue waiting for a
- response. You can get out of this by hitting the RETURN key. Sometimes it
- is necessary to hit either the ESCAPE key, or the Cancel key (F2) in order
- to return control to WordPerfect.
-
- The rule of thumb to use when defining macros is that if a keystroke
- command is available, use it instead of mouse moves.
-
- Making Room For The Editor
-
- Except for those using hard drives, WordPerfect users have been fighting
- a disk capacity problem. When WordPerfect moved the Print program from the
- program disk to the disk containing the library of printer drivers, it
- created a never-ending succession of disk swapping. Now, with Macro Editor
- also needing a home on an already overcrowded disk, it's time to look at
- alternatives.
-
- One solution is available that will not only accommodate the needed space
- required by the Macro Editor, but will also curtail the annoying disk swap
- needed each time a data disk needs to be replaced with the Print disk prior
- to generating hard copy.
-
- By removing the WordPerfect help files from the program disk, enough
- space is created to comfortably accommodate both the Macro Editor and the
- Print routines required by WordPerfect. The ReadMe file on the WordPerfect
- program disk lists the files that need to be copied from the print disk to
- the program disk.
-
- For users who are basically comfortable with WordPerfect, the sacrificing
- this access to the help files will more than make up for eliminatig disk
- swapping in order to print, and by the creation of enough disk space to
- handle not only the printer files and Macro Editor, but even an assortment
- of favorite utilities.
-
-
-