At 08:52 -0500 2001-04-13, David Steffen wrote:
>WordPerfect is what my wife uses, but it is not being maintained and is
>fairly incompatable with everyone else.
Combined with MaclinkPlus, compatibility of WordPerfect is not bad at all.
It also plays very well with MacPerl. May I recommend to have a look at my
"WordPerfect DocCompare", a fast document comparison script built around
the Algorithm::Diff Perl module? I mainly use BBEdit but often find myself
going to WordPerfect just to compare a pair of text files.
http://www.versiontracker.com/moreinfo.fcgi?id=9154
http://www.ils.uec.ac.jp/~herr
About scripting WordPerfect with MacPerl: Apart from the documented
AppleScript interface, the internal binary data of any open WordPerfect
window can be accessed as <<class WPD2>>. It consists of text with
embedded codes that are not too hard to figure out and to parse with
regular expressions. As an example, the following script uses MacPerl to
extract all 'targets' of cross-references from the front window.
--------------------------------------------------------------------------
ignoring application responses
tell application "MacPerl"
Do Script {"
MacPerl::Quit(3);
$wp = shift; #get the name of WP
$wp =~ s/([\"\\\\])/\\\\$1/g; #escape quotes and backslashes
$wp = qq/app \"$wp\"/;
#Get the binary data of the front window
$_ = MacPerl::DoAppleScript qq{ window 1 of $wp as \\xC7class WPD2\\xC8 };
#Extract and decode the hex string returned by AppleScript
s/^.{10}//s; chop; $_ = pack 'H*', $_;
while (/\\xD7\\x08\\x00(.)(.)([\\x20-\\xFF]{1,31})\\x00(.)\\x08\\xD7/gs) {
next if length($3)!=ord($2) or $1 ne $4 or ord($1)-ord($2)!=5;
$target_list .= qq/$3\\n/;
}
$target_list =~ s/([\"\\\\])/\\\\$1/g;
MacPerl::DoAppleScript qq{
tell $wp to make new window with data \"$target_list\"
};
", Application "WordPerfect" as Text}
end tell
end ignoring
--------------------------------------------------------------------------
WordPerfect is a free download, from
http://networkone.mac.tucows.com/files/tucows_corelwrdprf.hqx
Gero Herrmann
Nishinomiya, Japan