I finally wrote a small Applescript (see attached file) that allows to convert Omnigraffle files to PDF, PNG... directly from the command line. In order to use it, go to LyX preferences, add an OmniGraffle file format (just type "auto" for the editor), and then add converters. By now, I successfully added converters from OmniGraffle to PNG, EPS and PDF. Here are the commands I used:

OmniGraffle -> PDF (ps2pdf)
Converter: osascript replace/with/path/to/og-export.scpt `pwd`/$ $i `pwd`/$$o pdf

OmniGraffle -> EPS
Converter: osascript replace/with/path/to/og-export.scpt `pwd`/$ $i `pwd`/$$o eps

OmniGraffle -> PNG
  Converter: osascript replace/with/path/to/og-export.scpt $$i $$o png

To developers: the `pwd` command is used only with PDF and EPS because $$i and $$o are not substituted in the same way (absolute path for PNG and only file name for PDF and EPS). I suspect that this difference corresponds to vector and non vector graphics formats. Why such a distinction?

Note that I've just put a new version of "og-convert.scpt" on the LyX wiki. This new version eliminates a bug occurring when the '.graffle' file extension wasn't displayed in the Finder.

--
Mael Hilléreau
http://mael.hillereau.free.fr



Reply via email to