Applescript Bundle and Python

Basically, I want to run a Python script from the applescript package

So, I linked the file (Controller.py) inside the package

I need to run a script

do shell script "PYTHONPATH = / Applications / gtk / inst / lib / python2.6 / site-packages python / path / to / Controller.py

I want to access Controller.py from the package

So how do you access linked files through bash?

+4
source share
1 answer

Use path to me to get the location of the AppleScript binding, then find the script relative to it:

 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) 
+5
source

Source: https://habr.com/ru/post/1333364/


All Articles