Bug Applescript freezes Video - Put Applescript function in background thread
#16
So i've created a python script as follows:

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.
Reply
#17
Thanks to Memphiz for your efforts and special thanks to Winestock for your workaround!
Finally a working solution i've been looking for a very long time. Big Grin
Reply
#18
Glad it works for you. Use this for changing the volume as well. No more small pause.
Kodi 17, Transparency Skin
PogoPlug v4 running Arm Linux 4.4.63 as MySQL (mariadb) server.
Mac OS 10.12.5
2015 27" iMac 3.3 GHz Quad, 16GB RAM, 1TB SSD
2015 13" Macbook Pro, 8GB RAM, 256GB SSD
AppleTV 4 TV OS 10
Reply

Logout Mark Read Team Forum Stats Members Help
Applescript freezes Video - Put Applescript function in background thread0