John Porter Simons wrote:

I can run appscript from an interactive session and just ignore the rocketship in the dock, but when I run the same script from a Apache/ mod_python, it hangs. Probably because Apache doesn't run as a normal user so it can't get a GUI context. This is a bummer, I was able to use rb-appscript from a web script, I wish I could use py- appscript...


You're correct that Apache normally runs under a restricted user which can't access the GUI. I'm assuming you were running your Ruby script as a regular user; perhaps you could use the same approach for your Python script? Another option might be to use remote Apple events to communicate with GUI apps running under a regular user. A third possibility would be to run Apache as a regular user. The relevant security caveats and cautions apply to all approaches, of course.

BTW, the Dock icon is a red herring here. Both appscript implementations uses the same Process Manager calls. However, the Process Manager only 'helpfully' upgrades processes launched from an .app bundle, and while the Python interpreter is packaged as an .app bundle, the Ruby interpreter is just a regular Unix-style executable.

HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to