28 maj 2006 kl. 02.47 skrev Chris Devers:

On Sun, 28 May 2006, David Cantrell wrote:

if instead you're doing something like ...

    system('open', '/Applications/Acrobat.app');

then you'll need to:

wait around until Acrobat appears in the process table;
wait around until that PID disappears;

Really??

In my experience, the `open` command immediately returns control to the controlling process (the shell, or whatever else invoked it (pine etc))
without waiting for the `open`ed application to finish, or for that
matter even to finish launching.

which is why processes have to be monitored manually...

I'm quite confident that David meant
system('/Applications/Adobe Reader 7.0.7/Adobe Reader 7.0.7.app/ Contents/MacOS/Adobe Reader', 'myfile.pdf');
using acroread as shorthand

This will block as long as the process is running, to just wait while the document is open, I'd probably try monitoring
`lsof | grep myfile.pdf`;
after system ('open',...

unless you can arrange for Acrobat to quit, which however would cause a lot of time wasted for launching if you will process more than one document...

(I assume the the full Acrobat can be controlled using Mac::Glue, but this does not seem possible for the Reader)


Reply via email to