Using Third-Party Modules with Python in an Automator Service -
i have installed py-appscript on machine , can used python installation @ /library/frameworks/python.framework/versions/current/bin/python
.
i trying use installation of py-appscript automator service. this, use run shell script action , set shell usr/bin/python
(which choice python, unfortunately).
the usr/bin/python
not appear have access third-party modules , crashes on line:
from appscript import *
is there way me give usr/bin/python
access third-party modules? or there way tell automator use /library/frameworks/python.framework/versions/current/bin/python
instead?
i need automator run python directly run shell script action. action calls python scripts external automator (via bin/bash
, example) not perform enough useful.
okay, able working using hack found @ how execute php shell script automator action on mac os x.
inside of run shell script action, used /bin/sh/
shell <<eof
... eof
proper python installation.
so example, entering
/library/frameworks/python.framework/versions/current/bin/python <<eof appscript import * numbers = app('numbers') eof
into code section of run shell script action work. 1 can call proper installation (/library/frameworks/python.framework/versions/current/bin/python
above) , put program between <<eof
... eof
delimeters.
alfred
this trick works alfred also. if want use appscript
alfred, make sure pass {query}
python version above, this:
/library/frameworks/python.framework/versions/current/bin/python script.py {query}
Comments
Post a Comment