基本上我想从AppleScript包中启动一个Python脚本
所以我将文件(Controller.py)捆绑在包
中我需要运行的脚本是
做shell脚本“PYTHONPATH = / Applications / gtk / inst / lib / python2.6 / site-packages python /path/to/Controller.py
我想从捆绑包中访问Controller.py
那么如何通过bash访问捆绑文件?
答案 0 :(得分:5)
使用path to me
获取AppleScript bindle的位置,然后找到相对于它的脚本:
set controller_script to (path to me as string) & "Contents:Resources:Controller.py"
do shell script "PYTHONPATH=/Applications/gtk/inst/lib/python2.6/site-packages python " & (quoted form of POSIX path of controller_script)