scripting a GUI app

S P Arif Sahari Wibowo arifsaha-/E1597aS9LQAvxtiuMwx3w at public.gmane.org
Fri Nov 14 00:38:04 UTC 2008


On Thu, 13 Nov 2008, Terrence Enger wrote:
> I am looking at calling OpenOffice, as one step within a 
> longer process, to edit a particular document.  `soffice 
> <filename>`, whether executed from a bash command line or a 
> system() call, returns to the caller real fast.  How can I 
> make the caller wait for the user to close the document?

I think the designed way of OpenOffice.org talking to external 
program is through UNO. Basically you run OpenOffice.org as a 
server, then have the external script / program connect to that 
server through the UNO mechanism. You can control and monitor 
almost all thing about OpenOffice.org.

In your case, if you just need to know whether the 
OpenOffice.org still there, maybe you can just do opening 
inquiry to that port. Or ideally the script can actually find 
out if the particular file still open (user may just close the 
file without quiting).

Here is the list of OpenOffice.org UNO implementation: 
http://wiki.services.openoffice.org/wiki/Uno/Implementations

> And I would expect a similar issue with any GUI application 
> that can open multiple documents.

For other application withough defined interface, probably the 
only way is for the script do ps to find if the application 
still there.

-- 
                              (stephan paul) Arif Sahari Wibowo
    _____  _____  _____  _____
   /____  /____/ /____/ /____
  _____/ /      /    / _____/      http://www.arifsaha.com/
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list