Execute shellscript or Applescript on key not working
#1
Tried with:
Code:
<FullscreenVideo>
    <joystick name="Harmony">
      <!-- up           -->      <button id="1">BigStepForward</button>
      <!-- down          -->      <button id="2">BigStepBack</button>
      <!-- left           -->      <button id="3">StepBack</button>
      <!-- right          -->      <button id="4">StepForward</button>
      <!-- menu           -->      <button id="6">OSD</button>
      <!-- Prev        -->      <button id="32">SmallStepBack</button>
      <!-- Info      -->      <button id="31">Info</button>
      <!-- F7        -->      <button id="95">NextSubtitle</button>
      <!-- F6        -->      <button id="94">ShowSubtitles</button>
      <!-- 4         -->      <button id="14">System.Exec("/Users/me/Desktop/myshellscript")</button>
    </joystick>
  </FullscreenVideo>
and
Code:
<FullscreenVideo>
    <joystick name="Harmony">
      <!-- up           -->      <button id="1">BigStepForward</button>
      <!-- down          -->      <button id="2">BigStepBack</button>
      <!-- left           -->      <button id="3">StepBack</button>
      <!-- right          -->      <button id="4">StepForward</button>
      <!-- menu           -->      <button id="6">OSD</button>
      <!-- Prev        -->      <button id="32">SmallStepBack</button>
      <!-- Info      -->      <button id="31">Info</button>
      <!-- F7        -->      <button id="95">NextSubtitle</button>
      <!-- F6        -->      <button id="94">ShowSubtitles</button>
      <!-- 4         -->      <button id="14">RunAppleScript("/Users/me/Desktop/myscript.applescript")</button>
    </joystick>
  </FullscreenVideo>

but neither Script is executed.

Do I have to install any add-on?

Can anyone post an example, how to run a script in XBMC Mac?

Thanks

Pete
Reply
#2
I'm not sure you can actually use System.Exec() in the keymap, but winestock seems to have got AppleScript working in this thread (see post #6 onwards). Although from your code, it looks like your "RunAppleScript" should just be "RunScript"
Reply
#3
Pete248,

userdata/keymaps/keymap.xml has been depreciated, the file needs to be called keyboard.xml. System.Exec does work from userdata/keymaps/keyboard.xml.
Reply
#4
Well I actually didn't create a userdata/keymaps/keyboard.xml but edited a copy of the harmony.xml in the application bundle. Probably that doesn't work for executing scripts.

I'll copy the harmony.xml to userdata/keymaps/keyboard.xml and try to execute the scripts from there.

Just a few things to clarify:

Does the parameter in system.exec have to be in quotes?
Does the capitalization matter?
Do I have to put a XBMC. in front of system.exec or RunAppleScript?
Is the command to run an AppleScript RunAppleScript or RunScript?

Pete
Reply
#5
Pete248,

Not a good idea to modify data in the XBMC.app contents as it would get overwritten when an update were to occur.

To answer your questions:

Does the parameter in system.exec have to be in quotes? No
Does the capitalization matter? I don't think so
Do I have to put a XBMC. in front of system.exec or RunAppleScript? No
Is the command to run an AppleScript RunAppleScript or RunScript? I use RunScript
Reply
#6
winestock Wrote:Is the command to run an AppleScript RunAppleScript or RunScript? I use RunScript

I wasn't able to execute a unix command through System.Exec. Sad

But RunScript works for the AppleSripts. So I got what I wanted.

Btw. if you are interested for what I needed it: I trigger a switch display rate via the AppleScripts. Thus I can switch between 24p, 50p, 60p while a movie is running in fullscreen by pressing 4, 5 or 6. The display shows a blue screen for a fraction of a second, but the movie continues to play afterwords now with the new display refresh rate. Not as elegant as the still not working "Auto adjust display refresh rate" but close to it. Smile

Pete
Reply

Logout Mark Read Team Forum Stats Members Help
Execute shellscript or Applescript on key not working0