Kodi Community Forum

Full Version: Basic how to run applescript in XBMC question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've written a basic script that quits XBMC and opens Safari. I can run it in the Applescript editor program without a problem. I can't seem to make it work in XBMC.

In Advanced Launcher (I'm running Eden), I have the platform as "Macintosh" and for "Advanced settings" I have the following:

Change Application: (my correct path to the script)
Modify Arguments: blank
Change ThumbsPath: blank
Change Fanarts Path: blank
Change Custom Path: blank
Toggle XBMC Fullscreen: On.

I have the sense I'm making a very basic error here -- just don't know what it is. Thanks for any help.
(2013-01-13, 02:53)csgnyc Wrote: [ -> ]I've written a basic script that quits XBMC and opens Safari. I can run it in the Applescript editor program without a problem. I can't seem to make it work in XBMC.

In Advanced Launcher (I'm running Eden), I have the platform as "Macintosh" and for "Advanced settings" I have the following:

Change Application: (my correct path to the script)
Modify Arguments: blank
Change ThumbsPath: blank
Change Fanarts Path: blank
Change Custom Path: blank
Toggle XBMC Fullscreen: On.

I have the sense I'm making a very basic error here -- just don't know what it is. Thanks for any help.
I may be wrong, because I'm not a MAC user, but a script is not an application. You need to indicate the script interpreter as the application (I think it is osascript for MAC) and the path to your script as argument (may you will also need to indicate a switch).

(2013-01-13, 02:53)csgnyc Wrote: [ -> ]I've written a basic script that quits XBMC and opens Safari. I can run it in the Applescript editor program without a problem. I can't seem to make it work in XBMC.

In Advanced Launcher (I'm running Eden), I have the platform as "Macintosh" and for "Advanced settings" I have the following:

Change Application: (my correct path to the script)
Modify Arguments: blank
Change ThumbsPath: blank
Change Fanarts Path: blank
Change Custom Path: blank
Toggle XBMC Fullscreen: On.

I have the sense I'm making a very basic error here -- just don't know what it is. Thanks for any help.

In userdata/addon_data/plugin.program.advanced.launcher/launchers.xml:
Code:
<application>/usr/bin/osascript</application>

In the same script between <args> and </args> put the the complete file path (including the name of the applescript) of where your applescript resides.
Thanks. Still not working but I think we're close. I edited the XML file that winestock referred to so it now reads (hope someone ses the problem):


<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<launchers>
<launcher>
<id>b2a0d6aa5f6543579b31c9c2ded8eaee</id>
<name>launch safari from xbmc</name>
<application>/usr/bin/osascript</application>
<args>/Users/csgnyc/Desktop/launch safari from xbmc.scpt</args>
<rompath></rompath>
<thumbpath></thumbpath>
<fanartpath></fanartpath>
<custompath></custompath>
<romext></romext>
<platform>Macintosh</platform>
<thumb></thumb>
<fanart></fanart>
<genre></genre>
<release></release>
<publisher></publisher>
<launcherplot></launcherplot>
<minimize>true</minimize>
<lnk></lnk>
<roms>
</roms>
</launcher>
</launchers>
Use double quotes to avoid your script path be interpreted as several arguments due to the presence of spaces.
Code:
...
<args>"/Users/csgnyc/Desktop/launch safari from xbmc.scpt"</args>
...
(2013-01-13, 04:41)Angelscry Wrote: [ -> ]Use double quotes to avoid your script path be interpreted as several arguments due to the presence of spaces.
Code:
...
<args>"/Users/csgnyc/Desktop/launch safari from xbmc.scpt"</args>
...

Thanks. That solved the problem.