[MAC] AppleScripts - XBMC for Mac now supports AppleScript
#1
Thumbs Up 
Applescript support added in http://trac.xbmc.org/changeset/23912. Testors welcome.
Reply
#2
It would be nice if it was abstracted somehow instead of ifdef ..

Windows has batch files
Linux has shell scripts
Apple has apple scripts
The normal XBMC log IS NOT a debug log, to enable debug logging you must toggle it on under XBMC Settings - System or in advancedsettings.xml. Use XBMC Debug Log Addon to retrieve it.
Reply
#3
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.
Reply
#4
Thanks!
Applescript support works. I'm now using it to control my imac system volume via apple remote.
Reply
#5
Question 
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
Reply
#6
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
Reply
#7
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...
Reply
#8
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
Reply
#9
Capitalisation of RunScript should make no difference at all.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
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.
My skins:

Amber
Quartz

Reply
#11
ping :-)
My skins:

Amber
Quartz

Reply
#12
applescripts need to be in the form of an addon, as does any type of script be it bash or python.
Reply
#13
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?
Reply

Logout Mark Read Team Forum Stats Members Help
[MAC] AppleScripts - XBMC for Mac now supports AppleScript0