You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a rough-and-ready WP Unix macro that converts the current document to DOCX format, using the pandoc document converter. It requires pandoc version 2.14.2 or later, and Ubuntu (probably like some other distros) supplies only an earlier version, so you'll need to get the binary here (for debian-based distros, download the .amd64.deb)
The macro assumes that the pandoc executable is /usr/bin/pandoc; if other distributions put it somewhere else, edit the macro for the correct location. The macro tests for the presence of pandoc, but I don't know how to make it test for the correct version.
The macro first saves the current document (without asking you first; maybe I should fix this), then runs the WP-supplied cvt program to create a temporary RTF version of the document; then runs pandoc to convert from RTF to DOCX, and, by default, shows the converted file in the WP List Files screen (this last behavior can be turned off by changing one line in the macro).
The output file has the same path and filename as the original file, with an added .docx extension.
At the moment, the macro does not ask if you want to overwrite an existing docx file - it just goes ahead and overwrites it. I can add that prompt later.
I've tested this only in WSL Ubuntu, but I think it should work in non-Windows debian-based Linux.
By the way: in WSL Ubuntu, you should probably create a wpmacros folder somewhere in your home folder, and copy all the files in opt/wp80/wpmacros into that new folder; then go to Shift-F1 Location of Files, and specify the new folder as the location for macro and keyboard files. On my setup, I don't have write access to /opt/wp80/wpmacros and so can't edit or create keyboards and macros there.
EDIT: Fixed the link.
The text was updated successfully, but these errors were encountered:
I've now fixed a few errors in the macro, and added a prompt asking whether to overwrite an existing file. (I forgot how tricky it can be to make WP detect an existing file.) Same download link as before.
And I've now revised this so that, by default, it opens the docx file in the default application in either pure Linux or WSL - but WSL needs the wslview utility installed. In the future, I'll check for this, but this seems pretty good for now.
You can change this feature by editing the macro as described near the top of the file.
Here is a rough-and-ready WP Unix macro that converts the current document to DOCX format, using the pandoc document converter. It requires pandoc version 2.14.2 or later, and Ubuntu (probably like some other distros) supplies only an earlier version, so you'll need to get the binary here (for debian-based distros, download the .amd64.deb)
https://github.com/jgm/pandoc/releases
The macro assumes that the pandoc executable is /usr/bin/pandoc; if other distributions put it somewhere else, edit the macro for the correct location. The macro tests for the presence of pandoc, but I don't know how to make it test for the correct version.
The macro first saves the current document (without asking you first; maybe I should fix this), then runs the WP-supplied cvt program to create a temporary RTF version of the document; then runs pandoc to convert from RTF to DOCX, and, by default, shows the converted file in the WP List Files screen (this last behavior can be turned off by changing one line in the macro).
The output file has the same path and filename as the original file, with an added .docx extension.
At the moment, the macro does not ask if you want to overwrite an existing docx file - it just goes ahead and overwrites it. I can add that prompt later.
Here's the macro:
https://www.dropbox.com/s/6op1nbrfuc5esi8/wptodocx.wpm?dl=1
I've tested this only in WSL Ubuntu, but I think it should work in non-Windows debian-based Linux.
By the way: in WSL Ubuntu, you should probably create a
wpmacros
folder somewhere in your home folder, and copy all the files inopt/wp80/wpmacros
into that new folder; then go to Shift-F1 Location of Files, and specify the new folder as the location for macro and keyboard files. On my setup, I don't have write access to/opt/wp80/wpmacros
and so can't edit or create keyboards and macros there.EDIT: Fixed the link.
The text was updated successfully, but these errors were encountered: