Posted: Thu Jan 26, 2006 1:45 pm Post subject: Scripting NeoOffice with AppleScript
I have an applescript that while admitedly a hack, will open a .doc document in MS Word, send it to Preview and save it as a PDF. It uses OS X 10.4 UI scripting to do it thing via the programs' menus.
I was hoping to be able to replace this directly with NeoOffice's "Export to PDF' functions but none of the UI element finding programs I have can find the hierarchical path to NeoOffice's menu bar. They all do find the main NeoOffice menu but they can't find the menu for the Document editor program tha appears with an open text document.
Can anybody help with this? Alternatively (or perhaps better) is there some other code that an external program (the actual program driving all this is a very large document indexing research system written in Java and running across 20 computers) can use to push a .doc document through NeoOffice and get back a PDF?
Please don't suggest any of the Doc2pdf programs that abound in free and commercial versions. None of them are robust enough to deal with complex Word documents. The only two programs that are (after years of on an off experimentation) are MS Word itself and OOo (hence neooffice).
Are you using Neo 1.2 Beta? I ask because Apple hooked Java up to all of its Accessibility APIs in Java 1.4, and Neo 1.2 is the first version to use 1.4. (I'm also assuming that the Acessibility stuff should be enough to let UI scripting work, at least as far as the menu bar is concerned.)
It may be, however, that the way in which the menus are constructed--OOo menus are ugly, and the code to make them native seems sometimes like it's tricky and fragile--prevents UI scripting from finding the rest of the menus.
As the previous poster mentioned, either an OOo macro or some sort of UNIX-y script (OOo includes a copy of Python, so it must be accessible at least to Python if not other languages--I forget what other languages have UNO bindings) might offer a solution, and the latter should definitely be able to integrated into the AppleScript workflow.
Smokey
(who wishes there were an AppleScript bridge for UNO) _________________ "[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Posted: Mon May 26, 2008 1:14 pm Post subject: Re: Scripting NeoOffice with AppleScript
Did you ever find the solution? I'm interested in the very same task...
bests
MR
ArticleResearch wrote:
I have an applescript that while admitedly a hack, will open a .doc document in MS Word, send it to Preview and save it as a PDF. It uses OS X 10.4 UI scripting to do it thing via the programs' menus.
I was hoping to be able to replace this directly with NeoOffice's "Export to PDF' functions but none of the UI element finding programs I have can find the hierarchical path to NeoOffice's menu bar. They all do find the main NeoOffice menu but they can't find the menu for the Document editor program tha appears with an open text document.
Can anybody help with this? Alternatively (or perhaps better) is there some other code that an external program (the actual program driving all this is a very large document indexing research system written in Java and running across 20 computers) can use to push a .doc document through NeoOffice and get back a PDF?
Please don't suggest any of the Doc2pdf programs that abound in free and commercial versions. None of them are robust enough to deal with complex Word documents. The only two programs that are (after years of on an off experimentation) are MS Word itself and OOo (hence neooffice).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum