2014-05-19, 11:46
So i've created a python script as follows:
If i try to test it in Terminal i get the following:
Of course this directory does not exist. It should be /Users/macmini_home/Documents/SCRIPTS/_test_VU.applescript instead of /Users/macmini_home/Documents/SCRIPTS/_test_VD/Users/macmini_home/Documents/SCRIPTS/_test_VU.applescript
What am i doing wrong here?
[EDIT:]
Got it working by (of course) leaving your script as it is and just add the applescript into the same location as the python script.
Code:
#!/usr/bin/env python
import sys
import os
whichOS = sys.platform
if whichOS == 'darwin':
whichScript = "\"" + os.path.splitext(__file__)[0] + "/Users/macmini_home/Documents/SCRIPTS/_test_VD.applescript\""
os.system("/usr/bin/osascript " + whichScript + " &")
If i try to test it in Terminal i get the following:
Code:
macmini-home:~ macmini_home$ /Users/macmini_home/Documents/SCRIPTS/_test_VD.py
macmini-home:~ macmini_home$ osascript: /Users/macmini_home/Documents/SCRIPTS/_test_VD/Users/macmini_home/Documents/SCRIPTS/_test_VU.applescript: No such file or directory
Of course this directory does not exist. It should be /Users/macmini_home/Documents/SCRIPTS/_test_VU.applescript instead of /Users/macmini_home/Documents/SCRIPTS/_test_VD/Users/macmini_home/Documents/SCRIPTS/_test_VU.applescript
What am i doing wrong here?
[EDIT:]
Got it working by (of course) leaving your script as it is and just add the applescript into the same location as the python script.