Remote Apple Events
Remote Apple Events
- Subject: Remote Apple Events
- From: Justin Miller <email@hidden>
- Date: Fri, 15 Mar 2002 11:57:00 -0500
Hi all,
I'm new to this list, but I've been browsing the archives a bit. I'm not
sure if this question is within the scope of this list or not, but i'm
stumped on finsing an answer, so here goes...
I'm trying to use Apple Events from a CGI on OS X. I've written the CGI
in perl, and I call /usr/bin/osascript to handle applescript snippets.
I'm trying to control several applications (I'll only talk about Adobe
Acrobat Distiller for brevity..) to get some output. Now, the code and
applescript runs fine when run from the terminal. But when run as the
"www" user, it can't connect to the applications. Fine, that's
understandable. So I try doing it through remote apple events. Simple
scripts from this and other machines to do simple things like quit
TextEdit, etc, will work, but the CGI still does not. I get the followin
from every app I'm trying to send events to:
*** CFLog (20): /usr/bin/osascript[1878] Authentication: Authorization
is required to for \u201Acrobat Distiller 4.0\u2019 on
\u2018eppc://localhost\u2019.
(that's fine. it brings up the authentication dialog, I type my username
and password, save it to the kering, no problems so far.)
But then I get this:
execution error: Acrobat Distiller 4.0 got an error: Application isn't
running. (-600)
Which, of course, isn't true. I've tried several things, from including
and not including full paths in both Mac and Unix format to the
applications, to attempting to say "eppc://username@localhost" instead
of just "eppc://localhost", etc. What confuses me is that it's obviously
connecting through remote apple events, because it's authenticating. But
why can't it see that I'm running the applications? (Or even try to
"start" them with the activate command?)
If anyone has any insight into this, it would be much appreciated.
Here's a snippet of applescript i'm using to control Distiller. (In the
form that handed to osascript, after perl munges it..)
set remote_distiller to application "Classic:Applications (Mac OS
9):Adobe Acrobat 4.0:Distiller:Acrobat Distiller 4.0" of machine
"eppc://localhost"
using terms from application "Classic:Applications (Mac OS 9):Adobe
Acrobat 4.0:Distiller:Acrobat Distiller 4.0"
tell remote_distiller
activate
open ("Classic:PS_OUT:temp.ps" as alias) destination
("Classic:Example:output.pdf" as alias) wait true
end tell
end using terms from
Thanks,
Justin
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.