Kodi Community Forum

Full Version: [MAC] AppleScripts - XBMC for Mac now supports AppleScript
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Applescript support added in http://trac.xbmc.org/changeset/23912. Testors welcome.
It would be nice if it was abstracted somehow instead of ifdef ..

Windows has batch files
Linux has shell scripts
Apple has apple scripts
CrashX Wrote:It would be nice if it was abstracted somehow instead of ifdef ..

Windows has batch files
Linux has shell scripts
Apple has apple scripts

Hehe, you know the drill, make a trac ticket. Trac tickets are golden.
Thanks!
Applescript support works. I'm now using it to control my imac system volume via apple remote.
Hi,

I hope some one could help me about my problem.

I have installed XBMC for MAC on my MAc mini 2009
OS: 10.6.3
If you need more Infos, please ask

I wanted to modify the Programs entry in the main Menue in the home.xml.
I changed the <onclick> event to RunAppleScript(Do Shell script "bla bla")
but it is simly not working. Sad

I have made a test, if I changed it in the wrong place, so I changed the onklick
event to Mediacontrol.Stop or somsthing like that just to stop a playing video to
se if my modification is working. And it workd.

So what I'm doing wrong here with the RunAppleScript. Didn't find anything useful at the forums here Sad

If some one could please help me out here it would be great.

Thanks

Regards
Vlaves
Vlaves Wrote:Hi,

I hope some one could help me about my problem.

I have installed XBMC for MAC on my MAc mini 2009
OS: 10.6.3
If you need more Infos, please ask

I wanted to modify the Programs entry in the main Menue in the home.xml.
I changed the <onclick> event to RunAppleScript(Do Shell script "bla bla")
but it is simly not working. Sad

I have made a test, if I changed it in the wrong place, so I changed the onklick
event to Mediacontrol.Stop or somsthing like that just to stop a playing video to
se if my modification is working. And it workd.

So what I'm doing wrong here with the RunAppleScript. Didn't find anything useful at the forums here Sad

If some one could please help me out here it would be great.

Thanks

Regards
Vlaves

Can't help without seeing xbmc.log when you try the <onclick> event
There seems to not be much documentation for RunAppleScript.

I have a script in ~/Library/Application Support/XBMC/scripts called VolumeUp.applescript
It runs correctly if I launch it manually from the Scripts pane.


No matter what path I try (I've tried a lot) in my keymap though, it doesn't seem to work.


<FullscreenVideo>
<joystick name="AppleRemote">
<button id="1">XBMC.RunAppleScript(/Users/me/Library/Application Support/XBMC/scripts/VolumeUp.applescript)</button>
.............


I don't see anything in the log about remote presses (with debug enabled). I only see keyboard presses.
Can someone tell me for sure what syntax I should be using in keymap...
After spending some time away from it, I tried a few more things...

This is apparently what you're supposed to do.

<FullscreenVideo>
<joystick name="AppleRemote">
<button id="1">runscript(/Users/me/Library/Application Support/XBMC/scripts/VolumeUp.applescript)</button>
.............


RunAppleScript is apparently not a function and runscript will not work if you use RunScript as it's capitalized on the function list. Also you need to save your applescript as a .applescript not .scpt (File->Save As...->Text).

Hopefully this will help someone else in the future. I'm going to enjoy finally being able to control system volume instead of XBMC volume from my remote Smile
Capitalisation of RunScript should make no difference at all.
I would like to run AppleScript from a skin and I'm not able to find info regarding:

1.Script should have extension .scpt , I suppose?
2.Can it be placed in skin root folder ( skin.XXX/myapplescript.scpt )
3.Proper called XBMC action will then be <onclick>RunAppleScript(myapplescript.scpt)</onclick> ??
4.Do I have to use absolute paths or that's not necessary when sript is placed in skin root folder?
5. Did I forgot to ask something that I should need to know

Thanks.

EDIT: Judging from trac we need Plex installed in order to use Apple scripts :-) but then again I may be wrong as I'm no coder myself.
ping :-)
applescripts need to be in the form of an addon, as does any type of script be it bash or python.
I am trying to understand this too. Can anyone please share a code snippet / example, .. please?!

And is there a possibility to pass over arguments to the applescript?

What I am trying to achieve: I want to export and/or compress a selected movie. I already know how to do that in applescript, but I am confused on:

- How do I get the ability to select a (movie) file? Would I have to write a complete python script?!

- Or can the context menu be extended?

- And how do I pass over the actual selected (movie) file?