|
|
[The download file CODE2TXT.ZIP contains two
macros. See column at left.]
This macro can -
(1) change text surrounded by WordPerfect
format codes (e.g., [Bold On]...[Bold Off]) to text surrounded by user-defined plain-text markers
(e.g., <B>...</B>)
or do the opposite:
(2) change text bracketed by user-defined
text markers to WordPerfect format codes.
The first function (convert format codes
to text markers) is useful when converting (saving) a document
to ASCII or ANSI text but you want to identify the old text attributes
(format codes) with unique text markers, such as HTML tags or
to replace WordPerfect format codes with Folio, Ventura Publisher,
InDesign, or QuarkXpress markup codes, etc.
The second function (convert text markers
to format codes) can be useful to restore a document saved
after converting from codes to text markers with the first function,
or whenever you want to convert identical, marked strings of
text to formatted text (e.g., bold, redline, etc.). Note that
you can also use it to convert text marked with ordinary words
(up to 20 characters) and/or symbols (inserted with <Ctrl+W>).
The WordPerfect attribute codes that can be
converted (in v2.13) are:
- Italics
- Bold
- Underline
- Double Underline
- Small caps
- Redline
- Strikeout
- Shadow
- Outline
|
- Superscript
- Subscript
- Fine
- Small
- Large
- Very Large
- Extra Large
- Highlight *
|
You can choose any -- or all -- of these codes
from a menu. You can also choose to retain the original format
codes after converting the codes/markers, and/or delete all 'empty'
code pairs (i.e., a pair of on/off codes without anything between
them, such as [Bold][Bold]).
Instructions
- Back up your document.
- Play the macro.
- An initial menu will appear to let you choose
from the two basic options. Choose one of them and click OK.
- A two-page menu will appear. You can modify
any markers on any line in those menu pages, check (i.e., tick)
the adjacent checkbox, make optional choices with checkboxes
at the bottom of the menu pages, and click OK. If the chosen
menu item(s) is found the macro will change the item(s) to the
paired markers (or paired format codes) shown on the same
menu line(s) as the items you chose.
Tips
It probably goes without saying, but ... always
make a backup of your document before making extensive chnages
to it.
If you plan use the first menu option -- convert
format codes to text markers -- but your document has some
formatting that is undersirable (e.g., underlines) that should
be first changed to other formatting (e.g., italics), you can
do this (as a separate operation) with Ron Hirsch's Replace Codes - Plus
macro (on the Other Authors page here).
Then use the Code2Txt macro to change the new formatting to your
desired text markers.
If you use the second menu option -- convert
text markers to format codes -- you can also change text
bracketed with markers to WordPerfect styles by (1) first
changing the text markers to format codes not used elsewhere
in your document -- such as Redline or Shadow (anything but
Outline) or Extra Large -- and then (in a separate operation)
use Ron Hirsch's Replace Codes - Plus macro (on
the Other Authors page here)
to change the Redline or Shadow or Extra Large text into your
desired style, such as one of the built-in Heading styles. For
example, you could chnage <h2>...</h2> into Heading
2. Note that, unlike changing to format codes ("text
attributes"), you cannot reverse this procedure with this
macro (though you should be able to do it using Edit, Undo),
so you might want to ensure you have made a backup first. (Thanks
to Victor Warner for this tip.)
Modifications
When the macro is played you can modify the
text markers directly on the menus.
To set menu defaults: Various choices -- menu
checkboxes, default text markers, etc. -- that are displayed
on menus when the macro plays can be set in the redlined User Modification Area at the top of the macro code. Simply open the macro
with Tools, Macro, Edit and follow the instructions and examples
in the Modification Area.
Known Limitations
1. The macro cannot process format codes that
might have been inserted inside a WordPerfect [Style]
code (including standard paragraph Headings and Outlines) or
inside a [Delay] code. Because such formatting is designed
to be relatively "hidden" from view, the macro does
not "see" the codes that cause the formatting.
2. The macro will not process the "redline"
and "strikeout" codes produced by File, Document,
Review. Those codes are very different from the normal attribute
codes for redline and strikeout (i.e., [Redline] and [StkOut])
accessible from the property bar (toolbar) or from Format, Font.
3. Starting with WordPerfect X4, a new Redaction
feature can mark text for deletion. However, the marks are "seen"
as ordinary gray highlighting by both Edit, Find and Replace
and by a macro's Search commands. Hence, the macro will skip
over these items in WPX4 (but not if the document is opened in
WPX3 or earlier, where these codes will be seen as normal highlighting).
A message will display to inform you about these codes and prompt
you to deal with them separately.
4. The second choice on the initial menu ("Convert
text markers to WordPerfect format codes") does not process
items inside headers, footers, footnotes, endnotes, or text boxes.
There are limitations in the macro language that make the process
unreliable with the way the macro is coded.
5. You should examine the document and make
any required changes in these areas by directly editing them.
You can use the File, Document, Compare method to produce a comparison
with the original document, which should make it easier to find
any discrepancies.
* Please
be aware that changing highlighting codes to text markers such
as <H> and </H> changes all instances of highlighting
regardless of the highlight color, and changing text markers
back to highlighting uses the current highlight color
-- i.e., the one chosen on the main toolbar (or with Tools, Highlight,
Color).
Page
Top
|
|
Disclaimer
The materials and any software
contained on this site are offered without warranty or guarantee
of any kind, either express or implied, including but not limited
to implied warranties of merchantability, satisfactory quality,
fitness for a particular purpose, noninfringement, or those arising
by law, statute, usage of trade, course of dealing or otherwise,
and are provided on an "as is," and "with all
faults" basis. The entire risk as to the results and performance
of these materials is assumed by you. The author assumes no liability
whatsoever to you or any other entity or third party for any
special, incidental, direct, indirect, or consequential damages
-- including without limitation any damages to equipment, or
for loss of profits, for business interruption, for loss of data
or other information, or for any other loss arising out of the
use or inability to use these materials, techniques, suggestions,
or software programs, even if the author has been notified of
the possibility or actuality of such damages, or they are foreseeable.
Materials on these pages have been prepared with reasonable care
for educational and informative purposes. No representations
are made regarding the use or the results of the use of any macro,
suggestion, technique, or other material in terms of their correctness,
accuracy, reliability, or otherwise, and you are again cautioned
that you use them solely at your own risk. You are advised to
make backups of any important files before implementing any macro,
suggestion, or technique. Do not assume anything here is error
free.
The above Disclaimer also
applies to any communication the author may have with you.
The external links on this
site, or in any related materials or communications, do not constitute
an endorsement or guarantee of the linked sites, their visitors,
or their associated owners, operators, or staff. |