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

View WordPerfect for Windows files with formatting Apps
As explained in this earlier, related hint, I have hundreds of WordPerfect for Windows files with contents that I don't need to edit, but often view. Using the previous hint, they can be viewed in Terminal, but they lose all their formatting. (They can also be opened with NeoOffice or AbiWord, but both of these are fairly slow when I just want to quickly view a file's contents.) To solve the no formatting issue, I created a contextual menu item which converts a WordPerfect document to HTML, and then opens it in a browser window. Here's what you need to make it work:
  • OnMyCommand
  • wpd2html. The lipwpd folks have recently updated the Mac OS X download with a nice installer.
Once those are installed, add this command to your OnMyCommand command list, and you're ready to go -- just select a WordPerfect file in the Finder, control-click on it, and choose 'Preview WordPerfect file in browser' from the contextual menu.

[robg adds: I haven't tested this one...]
    •    
  • Currently 2.75 / 5
  You rated: 4 / 5 (4 votes cast)
 
[14,323 views]  

View WordPerfect for Windows files with formatting | 20 comments | Create New Account
Click here to return to the 'View WordPerfect for Windows files with formatting' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
View WordPerfect for Windows files with formatting
Authored by: one2meny on Sep 07, '06 10:20:37AM

I don't get it? I've copied the command using OMCedit. I've installed the wpd2html, which went by default to a folder "opt" at the root level of the HD. But, I execute the command on a word perfect document and it does not work. What am I missing?



[ Reply to This | # ]
View WordPerfect for Windows files with formatting
Authored by: deef on Sep 07, '06 07:32:39PM

What results are you getting?



[ Reply to This | # ]
View WordPerfect for Windows files with formatting
Authored by: deleted_user4 on Sep 07, '06 12:21:28PM

Try MacLink Plus Deluxe from DataViz. Converts just about anything to just about anything. A tad expensive for what it does, but definitely worth considering.



[ Reply to This | # ]
View WordPerfect for Windows files with formatting
Authored by: leebennett on Sep 07, '06 05:00:30PM

Though AbiWord is serving dutifully to let me put WordPerfect files into my InDesign documents, I'd wave very good karma in the direction of the person or company who finally realized that a WordPerfect import filter for InDesign CS2 would very much be a Good Thing.™



[ Reply to This | # ]
View WordPerfect for Windows files with formatting
Authored by: one2meny on Sep 08, '06 03:33:28PM

None, that's the problem. I execute the command through the contextual menu on one of my student's word perfect papers and nothing happens at all. No web browser opens, no change to the file is made, just nothing. Do I need to put the wp2html file somewhere special? Right now it is in the default HD/opt/wpcnv/bin/ location that it installed to.

Thanks for your help and it's a great tip, I just know nothing about unix.



[ Reply to This | # ]
View WordPerfect for Windows files with formatting
Authored by: deef on Sep 08, '06 07:00:24PM

If you open a terminal window and type

which wpd2html

does it show you the path?

If not you will need to add the path to your .bash_profile (a file of commands which is run each time you open a terminal window). The easiest way to do this is to 1) open a terminal window
2) enter the command

cd ~

3) enter the command

cp .bash_profile .bash_profile.old

thereby making a copy in case something gets screwed up...you can reverse this if you need to by typing cp .bash_profile.old .bash_profile

4) enter the command

pico .bash_profile

to open the pico text editor (or you can do this with another text editor of your choice...being an old pine hand I like pico...)

5) scroll to the bottom of the document (it may be completely blank)

6) add the following lines

PATH=$PATH:"/opt/wpcnv/bin"
export PATH

7) hit ctrl-X to exit, Y to confirm the changes, and accept the existing filename

8) to test this, once you've exited pico, type

source .bash_profile
which wpd2html

it should now show you the path.

It should work then...



[ Reply to This | # ]
When I enter "cp .bash_profile .bash_profile.old", I get...
Authored by: jiclark on Sep 09, '06 04:59:16PM

cp: .bash_profile: No such file or directory

And this is after I've cd-ed to my home directory. Why wouldn't I have a bash_profile?

Man, the CLI can sure stump me...

TIA,
John



[ Reply to This | # ]
When I enter "cp .bash_profile .bash_profile.old", I get...
Authored by: deef on Sep 11, '06 12:16:48PM

Hi -- I didn't consider that possibility since I've already loaded lots of stuff into my .bash_profile -- but even if you get the "No such file or directory" message on step 3 you can actually proceed with step 4 -- when you type the command

pico .bash_profile

pico (the text editor) will either edit it (if it exists) or create it (if it doesn't), so the rest of the steps will be the same.

df



[ Reply to This | # ]
make sure wpd2html is in your PATH
Authored by: deef on Sep 08, '06 07:19:38PM

see the comment above...just forgot to change the title



[ Reply to This | # ]
View WordPerfect for Windows files with formatting
Authored by: ChrisH3677 on Sep 08, '06 06:06:19PM

Please give more details on how to install this command. Even using OMCEdit I couldn't get this to work. Is a logout or reboot required? I relaunched Finder which was good enough for OMC. I've got 28 apps open at the moment so don't really want to logout or reboot if I don't have to.

Can you provide a step by step process to install this command using OMCEdit?

thanks



---
Computer: Powerbook 15" Titanium 1Ghz 1GB RAM 60Gb HDD SuperDrive Tiger 10.4.3

Switched: August 2003



[ Reply to This | # ]
Install using OMCEdit
Authored by: deef on Sep 08, '06 07:16:56PM
Ok....the directions above were based on using a text editor to edit the OMC command file ( /yourusername/Library/Preferences/com.abracode.OnMyCommandCMPrefs.plist )

I've just removed my OMC commands and will try this with OMCEdit from scratch.

1) start OMCEdit
2) click New to add a new command
3) Enter whatever you want for the Command Name & Location (I prefer to set location to First Level since I use this so much :) )
4) set Activation Mode to file
5) set Execution Mode to Terminal -- I have tried this with the two Silent options and it doesn't work, for reasons unknown to me.
6) in the Command window enter the following: wpd2html __OBJ_PATH__ > ~/.wpdpreview.html; open ~/.wpdpreview.html
7) click save It should work then....if it doesn't check your path via the comment above & troubleshoot via the one I am about to post...

[ Reply to This | # ]
Test wpd2html manually in Terminal
Authored by: deef on Sep 08, '06 07:31:42PM

This will allow you to figure out whether the problem is with OnMyCommand or the wpd2html installation, by manually calling the commands.

1) open a new terminal window
2) type wpd2html pathtoyourfile/yourfilename > /~.wpdpreview.html

if you get the following response:

-bash: wpd2html: command not found

then follow the steps above to add wpd2html to your PATH

if you just get a blank line, things are probably working...

3) type

open ~/.wpdpreview.html

this should open your browser displaying yourfilename

If this works, then the problem is somewhere in OnMyCommand. The most likely problem is that (if you use OMCEdit) you have Execution Mode set to something other than Terminal -- or if you're editing the OMC preferences file manual, you have the following lines

<key>EXECUTION_MODE</key>
<string>exe_terminal</string>

but with something other than exe_terminal in between the string tags directly below the EXECUTION_MODE key. For reasons unknown to me, the command only works when the Execution Mode is set to Terminal



[ Reply to This | # ]
View WordPerfect for Windows files with formatting
Authored by: one2meny on Sep 09, '06 08:33:36AM

Thanks so much deef, you rock.



[ Reply to This | # ]
View WordPerfect for Windows files with formatting
Authored by: one2meny on Sep 09, '06 08:54:50AM

I made sure the bash profile has the PATH and everything comes out correct with that. I also double checked the OMCedit that the execute mode was terminal. Now when I run it, terminal opens, but I get this as the result (with the "!" to "rmt" being in 3 separate columns.

Last login: Sat Sep 9 11:47:21 on ttyp1
Welcome to Darwin!
sean-maccarthys-ibook-g4:~ maccarst$ <dict>
-bash: syntax error near unexpected token `newline'
sean-maccarthys-ibook-g4:~ maccarst$
Display all 973 possibilities? (y or n)
! ipcrm rdoc
. ipcs rdump
: ipf-mod.pl read
AppleFileServer ipfw readlink
BootCacheControl irb readonly
DirectoryService isc-config.sh reboot
KernelEventAgent jar refer
SystemStarter jarsigner reject
[ java renice
[[ java-rmi.cgi repquota
]] javac reset
a2p javadoc restore
ab javah return
ac javap rev
accept javaws revnetgroup
accton jconsole ri
aclocal jdb rlogin
aclocal-1.6 jinfo rm
addftinfo jmap rmdir
afmtodit jobs rmic
alias join rmid
apachectl jot rmiregistry
appleping jps rmt
sean-maccarthys-ibook-g4:~ maccarst$ _MODE</key>
-bash: syntax error near unexpected token `newline'
sean-maccarthys-ibook-g4:~ maccarst$
Display all 973 possibilities? (y or n)
sean-maccarthys-ibook-g4:~ maccarst$ g>act_file</string>
-bash: syntax error near unexpected token `newline'
sean-maccarthys-ibook-g4:~ maccarst$
Display all 973 possibilities? (y or n)



[ Reply to This | # ]
troubleshooting
Authored by: deef on Sep 09, '06 02:01:09PM

from the bits and pieces of XML in here it looks like something is up with OMC. Try the steps above to test wpd2html manually. If those work, I'd next try making sure you have latest versions of OMC and OMCEdit. Let me know what happens.



[ Reply to This | # ]
View WordPerfect for Windows files with formatting
Authored by: one2meny on Sep 10, '06 08:15:04PM

Alright, I manually tested it and in Terminal it didn't give me a blank line, it actually printed out in the Terminal all of the html formatted text. So, I'm assuming if it would have redirected to safari (my default browser), it would have worked. Deef, you've been very gracious with your help, thank you so much.



[ Reply to This | # ]
View WordPerfect for Windows files with formatting
Authored by: one2meny on Sep 10, '06 08:19:11PM

I just figured out the problem, it was the way I used OMCedit to create the command. Thanks for your patience Deef, this tip works awesome!!! Being in academia, I can never guarantee my student's paper formats.



[ Reply to This | # ]
speed gains
Authored by: deef on Oct 16, '06 08:02:07PM

using an iMac G5 1.8 Ghz PPC, 768 MB ram

with OpenOffice and Safari already running:

4k wpd opened with OpenOffice - 35 seconds
4k wpd opened with this script (using OnMyCommand and Safari) - 2 seconds

without the applications already running:

4k wpd opened with OpenOffice - 35 seconds
4k wpd opened with this script (using OnMyCommand and Safari) - 5 seconds



[ Reply to This | # ]
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 | # ]