Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'convert WordPerfect directly to RTF' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
convert WordPerfect directly to RTF
Authored by: klktrk on Nov 25, '06 11:52:57AM
If you are using Tiger or later, you can modify the On My Command to this:
/usr/local/bin/wpd2html __OBJ_PATH__ > ~/.Trash/wpdpreview.html; /usr/bin/textutil -convert rtf ~/.Trash/wpdpreview.html; open -a "TextEdit" ~/.Trash/wpdpreview.rtf

N.B.: 1) I installed my custom wpd2html in /usr/local/bin; replace this path with whereever you've installed wpd2html. Just make sure you use the full path. 2) I put the preview files in the trash so I don't have to remember to trash them later.

Here's the full command plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">;
<plist version="1.0">
<dict>
<key>COMMAND_LIST</key>
<array>
<dict>
<key>ACTIVATION_MODE</key>
<string>act_file</string>
<key>CATEGORIES</key>
<array>
<string>Editor</string>
</array>
<key>COMMAND</key>
<array>
<string>/usr/local/bin/wpd2html </string>
<string>__OBJ_PATH__</string>
<string> &gt; ~/.Trash/wpdpreview.html; /usr/bin/textutil -convert rtf ~/.Trash/wpdpreview.html; open -a "TextEdit" ~/.Trash/wpdpreview.rtf</string>
</array>
<key>EXECUTION_MODE</key>
<string>exe_shell_script</string>
<key>NAME</key>
<string>View WordPerfect as RTF</string>
<key>NOTES</key>
<string>Requires wpd2html. Submitted by Kristofer Widholm</string>
<key>OUTPUT_WINDOW_SETTINGS</key>
<dict/>
<key>REQUIRED_MAC_OS_MIN_VERSION</key>
<string>10.1</string>
<key>REQUIRED_OMC_VERSION</key>
<string>1.3.1</string>
<key>VERSION</key>
<integer>1</integer>
</dict>
</array>
<key>VERSION</key>
<integer>2</integer>
</dict>
</plist>


[ Reply to This | # ]
convert WordPerfect directly to RTF
Authored by: deef on Dec 13, '06 09:24:31AM

Hey, thanks for posting this. I had come up with more or less the same solution but hadn't posted.

Here's a bash script that can be run from the command line to convert WP files to rtfs. It assumes that wpd2html is installed and in your $PATH . Given filename.wpd it will create a new file filename.rtf . And it accepts multiple files as input so you can turn it loose on a whole directory.

#!/bin/sh
# bash script to convert wordperfect files to rtfs

for filename in "$@"
do if [ -z "$filename" -o ! -e "$filename" ]
then echo "Bad filename: $filename"
exit 1
fi
done

for filename in "$@"
do
#the actual conversion
wpd2html "$filename" > "$filename".html
textutil "$filename".html -convert rtf
rm -f "$filename".html

#cleanup
oldName="$filename"
newName=${oldName/.WPD/.rtf}
newName=${newName/.wpd/.rtf}
mv "$filename".rtf "$newName"
done;



[ Reply to This | # ]