|
How to copy plain-text macro code from
the Internet (i.e., web page, newsgroup post, or e-mail) into
WordPerfect to create a functioning macro
|
Notes
1) The macros here on the Toolbox for WordPerfect
site that can be downloaded (in .ZIP files)
to your system are already compiled and functioning (see Downloading
and Installing Macros and Templates).
The downloadable macros on the
Toolbox site are not the "raw" or "plain text"
macro code such as you might see posted on a web
page (even on some Toolbox pages) or a newsgroup. That kind of macro code is
simply a series of macro commands that were typed or copied
into the web site or newsgroup post as ordinary text characters.
These commands are not yet macros! The simple, step-by-step
procedure in the next column turns such plain-text macro code
into a functioning macro. Basically, the plain-text macro
code must be copied and then saved in WordPerfect in a certain
way before it becomes a macro that can be played.
2) If you use the first release of WordPerfect 11 (i.e., 11.0.0.233, as shown in your WordPerfect's
Help > About WordPerfect menu), then you should read this
page (in the WordPerfect 11 section) about a bug
in that release that can impact macros from any source,
even those from Corel that are shipped as part of the program. |
|
Once you have done this once or twice,
you will find it a simple and easy way of using macros that others
have written.
Step 1
Briefly examine the plain-text macro code
to determine where it begins and ends.
Often, macro writers will use programmer's
comments (in WordPerfect, they typically begin with two slash
marks, "//" [see here
for other types]) to tell you where the macro begins and ends.
If not, often the first command is an Application() command.
As often, the last command is usually Return or Quit. (Don't
worry if you don't see an Application, Return, or Quit command.
They are not always needed. Also, you can ignore any lines at
the beginning and end that contain only horizontal lines,
spaces, hyphens, or similar "separators.")
Note: On WordPerfect
Universe, the posted code is usually bracketed by a pair
of horizontal lines, like this:
code: ------------------------------------------------ // The actual
macro code goes here... // ...etc. ------------------------------------------------
The macro
commands are between the two horizontal
lines. In Step 2 below, be sure to make the selection directly
from the WordPerfect Universe Forum screen, not from inside
a "Post Reply" screen.
Step 2
Select all
text from beginning to end, and copy the selection to the Windows
clipboard with Ctrl+C (or Edit, Copy).
Note: On WordPerfect
Universe, selelect the macro between the two horizontal lines
from the post's main screen (shown in Step 1 above), NOT from
inside a "Post Reply" edit window. This will eliminate
WordPerfect Universe formatting tags added by the poster.
Step 3
Open a new, blank document in WordPerfect and click on Tools, Macro, Macro Toolbar
to display the Macro Toolbar.
Open Reveal Codes
if it is not already open (View, Reveal Codes). This helps with
the next step.
Step 4
Position your cursor
immediately after any codes in the new document -- typically,
this is immediately after the [Open Style][Ln Num: On]
codes. Look in Reveal Codes to see where the cursor is located,
and use the arrow keys to reposition it if necessary.
Then click on Edit, Paste Special, Unformatted
Text to paste the macro code into the WP document without
any extraneous formatting or other unwanted codes.
|
Important
Some macros are designed by their authors
to use Search and (sometimes) Replace commands to find various WordPerfect format [codes]
in the document and process them in some way. Unfortunately,
searching through a document for WordPerfect formatting codes
with a macro requires using the actual binary code in the SearchString/ReplaceString
command's parameter (the part of the command enclosed
in parentheses) -- and this binary code, unlike the rest of the
macro commands (which are ordinary text characters), cannot be
copied into a web page, newsgroup post, or email. It gets stripped
out in the web page, post, or email because other web sites or
Windows programs do not recognize WordPerfect format codes.
Most authors typically work around this limitation
by using plain text characters as a "placeholder" to
represent the binary code when it is posted on a web page
or newsgroup.
So, after you paste the macro code
into WordPerfect, be sure to replace any indicated text
placeholders in the SearchString() and ReplaceString() commands
(or where otherwise indicated by the author) with the actual
WordPerfect binary codes from the Codes button on the Macro Toolbar.
For example, if you see a command like this
-- SearchString("[HRt]") -- just delete the text string,
[HRt], inside the parentheses (but keep the two ordinary double
quote marks, if any) and, in its place, insert the actual
binary code with the Codes button on the Macro Toolbar.
Note that the Codes button brings up a long
list of codes. In our example, after you delete the text placeholder
you would place your cursor between the two (now adjacent) double
quote marks and click the Codes button on the Toolbar to bring
up the Macro Codes dialog containing a list of codes. Under the
Search tab in that dialog, choose HRt from the list, then click
the Insert button, then click Close. In Reveal Codes you
should now see a code [Macro Func], which is the binary
code, between the double quote marks. In the main document
window, it will display itself as the particular type of
code required by the macro (e.g., [HRt]). |
Step 5
Save the pasted material with the Save & Compile button on the Macro Toolbar.
Give the macro a name that will help you remember it.
This step saves the macro to your default
macros folder as shown in Tools, Settings, Files, Merge/Macro.
(Advanced users may wish to save to a different folder, and will
therefore need to include the path to that folder.)
The resulting file will have a .wcm filename
extension, which WordPerfect will recognize as a macro (assuming
it has valid commands inside it), and compile it the first time
you play it after creating it (or after editing it).
Messages:
If you get an error message when you press Save & Compile,
open Reveal Codes and check the pasted text for long lines that
may have wrapped into two or more lines with a hard return [HRt]
or line break [Ln Brk] between them. Remove the hard return(s)
or line break(s) to "glue" the lines back together.
Step 6
Play the macro
with Tools, Macro, Play (or Alt+F10).
Tips
- Note that the macro can be opened for editing
at a later time with Tools, Macro, Edit (or Ctrl+F10). It is
just another WordPerfect document, but with the special filename
extension .wcm. When you edit it, the Macro Toolbar will
reappear to let you Save & Compile any changes
- You may need to edit the Application() command
at the top of the code (if one exists) to change the language
code from "EN" (or "US" or other language)
to the language version you are using. Or, if you are using just
one language version of WP, just delete the last semicolon along
with the "EN," to get something like this:
Application (WordPerfect; "WordPerfect";
Default)
- You can delete any instructions, annotations,
or comments in the copied material (i.e., all text following
"//" marks up to the end of the line), though usually
there is no need to do so (and you may want to keep them for
future reference, anyway). Related tip: How
to put instructions or comments inside a macro.
- For easy access, you can assign the macro
to a keystroke combination, a toolbar button, or a menu. See
Customizing WordPerfect - Three easy
ways to play macros, load programs, type (insert) keystrokes,
and use special features by creating your own toolbar buttons,
shortcut keys ("hot keys"), and menu selections.
- For more information on creating and editing
macros, see Need
help creating macros and templates?
|