BUG - Applescript freezes Video - Put Applescript function in background thread

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
bigbadrabbit Offline
Senior Member
Posts: 162
Joined: Sep 2008
Reputation: 0
Location: Austria
Post: #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.

XBMC Gotham
OS X 10.9.3
Mac mini (late 2012) | i5 | 8GB RAM | SSD
(This post was last modified: 2014-05-19 12:05 by bigbadrabbit.)
find quote
bigbadrabbit Offline
Senior Member
Posts: 162
Joined: Sep 2008
Reputation: 0
Location: Austria
Post: #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

XBMC Gotham
OS X 10.9.3
Mac mini (late 2012) | i5 | 8GB RAM | SSD
(This post was last modified: 2014-05-19 12:10 by bigbadrabbit.)
find quote
winestock Offline
Fan
Posts: 442
Joined: Jan 2011
Reputation: 5
Post: #18
Glad it works for you. Use this for changing the volume as well. No more small pause.

XBMC Frodo 12.3, Transparency Skin (5.0.9)
PogoPlug v4 running Arm Linux 3.15 as MySQL (mariadb) and media file server for XBMC
Mac OS X 10.9.4
2011 27" iMac 3.4 GHz Quad, 16GB RAM, 1TB HD, 256GB SSD
2009 2.0GHz MacMini, 4GB RAM, 320GB HD
2009 17" Macbook Pro, 8GB RAM, 500GB HD
find quote
Post Reply