OS X How to?: XBMC use and control system volume -lock xbmc internal volume to full
#1
Can someone please tell me how to config XBMC to control OSXs volume when I click on the up and down remote on my apple remote that is connected to my mac mini.

At this point xbmc internal volume would be locked at full

Im using Transparency as the skin if that matters. I must be not searching correclty as system volume is not pulling up anything relevant on the forum

thanks for the help.

Reply
#2
(2012-05-24, 17:19)stormlight Wrote: Can someone please tell me how to config XBMC to control OSXs volume when I click on the up and down remote on my apple remote that is connected to my mac mini.

At this point xbmc internal volume would be locked at full

Im using Transparency as the skin if that matters. I must be not searching correclty as system volume is not pulling up anything relevant on the forum

thanks for the help.

XBMC does not support changing the OS system volume level only the internal XBMC volume level. This is what I did to solve it: http://forum.xbmc.org/showthread.php?tid=92382.
Kodi 17, Transparency Skin
PogoPlug v4 running Arm Linux 4.4.63 as MySQL (mariadb) server.
Mac OS 10.12.5
2015 27" iMac 3.3 GHz Quad, 16GB RAM, 1TB SSD
2015 13" Macbook Pro, 8GB RAM, 256GB SSD
AppleTV 4 TV OS 10
Reply
#3
Sorry, but could you tell me if this is correct?

Copy your keymap.xml and rename to keyboard.xml

place keyboard.xml in XBMC/userdata/keymaps in the actual XBMC package.

I open up appleScript editor. Paste your two scripts hit compile and then save the names as volumeup and volumedown and place them in a newly created folder called scripts in the XBMC/userdata dir.
Do need to do anything after that?

thanks
Reply
#4
(2012-05-24, 21:46)stormlight Wrote: Sorry, but could you tell me if this is correct?

Copy your keymap.xml and rename to keyboard.xml

place keyboard.xml in XBMC/userdata/keymaps in the actual XBMC package.

I open up appleScript editor. Paste your two scripts hit compile and then save the names as volumeup and volumedown and place them in a newly created folder called scripts in the XBMC/userdata dir

Do need to do anything after that?

thanks

You place the keyboard.xml in your userdata folder located in XBMC userdata folder. Do not modify the XBMC package. The userdata folder resides in ${HOME}/Library/Application Support/XBMC/userdata. If your home Library folder is hidden, hold down the option-key while selecting the Go menu. Once you setup the two apple scripts then you should be good to go. Make sure you modfy the keyboard.xml file with the items I mentioned the thread (i.e. assign the button to call the Volumeup apple script). There is no need to compile the apple scripts, just save them as a apple script text file.
Kodi 17, Transparency Skin
PogoPlug v4 running Arm Linux 4.4.63 as MySQL (mariadb) server.
Mac OS 10.12.5
2015 27" iMac 3.3 GHz Quad, 16GB RAM, 1TB SSD
2015 13" Macbook Pro, 8GB RAM, 256GB SSD
AppleTV 4 TV OS 10
Reply
#5
Still having issues.

keyboard.xml in:

/Users/mini/Library/Application Support/XBMC/userdata/keymaps

volumeup.applescript and volumedown.applescript in:

/Users/mini/Library/Application Support/XBMC/userdata/Scripts

I copied your pasted scripts to the 3 new files and checked to make sure they match.

Verified that the buttons are assigned to call the apple script:
<button id="1">RunScript(../scripts/VolumeUp.applescript)</button>
<button id="2">RunScript(../scripts/VolumeDown.applescript)</button>

I even copied the scripts to another location and had the full path in the keyboard.xml to match.

Am i being stupid here?




Reply
#6
Never mind. A good old fashion reboot fixed it.

Thank you so much for your help I appreciate it.

This has been such a big annoyance in regards to XBMC not including this.

Reply
#7
winestock, I'm not having so much luck with your approach. Here's my keyboard.xml:

Code:
<keymap>
  <FullscreenVideo>
    <joystick name="AppleRemote">
      <button id="1">RunAppleScript(/Users/Shared/XBMC_scripts/VolumeUp.scpt)</button>
      <button id="2">RunAppleScript(/Users/Shared/XBMC_scripts/VolumeDown.scpt)</button>
      <button id="3">SkipPrevious</button>
      <button id="4">SkipNext</button>
      <button id="5">Pause</button>
      <button id="6">Stop</button>
      <button id="7">OSD</button>
      <button id="8">ShowVideoMenu</button>
      <button id="9">SkipPrevious</button>
      <button id="10">SkipNext</button>
    </joystick>
  </FullscreenVideo>
</keymap>

Here are my AppleScripts:

Code:
-- volume up by 5
set current_volume to output volume of (get volume settings)

if current_volume is less than 100 then
        set current_volume to (current_volume + 5)
end if

set volume output volume current_volume
beep

Code:
-- volume down by 5
set current_volume to output volume of (get volume settings)

if current_volume is greater than 0 then
        set current_volume to (current_volume - 5)
end if

set volume output volume current_volume
beep

The AppleScript works if I run it from the Applescript editor. I also found that
  1. Relative script paths (e.g., ones with '..' in them) don't seem to work.
  2. If I use "RunScript" instead of "RunAppleScript", XBMC tries to run the scripts as if they were in Python instead of AppleScript.
  3. The fancier scripts that you used to control the volume in an earlier post tended to get stuck if the volume was close, but not quite at one of the volume levels in your "VolumeList" variable.

FYI, I'm trying to use XBMC as an alternative DVD player that actually has readable text at a distance, unlike the default player in OS X. The XBMC version is 11.0 (Git-20120321-14feb09), and my OS version is 10.7.4. I have a Mid 2010 Mac Mini. Here's my latest log, though I doubt it will do much good: http://pastebin.com/E5apr59Z
Reply
#8
(2012-06-03, 00:05)jjramsey Wrote: winestock, I'm not having so much luck with your approach. Here's my keyboard.xml:

Code:
<keymap>
  <FullscreenVideo>
    <joystick name="AppleRemote">
      <button id="1">RunAppleScript(/Users/Shared/XBMC_scripts/VolumeUp.scpt)</button>
      <button id="2">RunAppleScript(/Users/Shared/XBMC_scripts/VolumeDown.scpt)</button>
      <button id="3">SkipPrevious</button>
      <button id="4">SkipNext</button>
      <button id="5">Pause</button>
      <button id="6">Stop</button>
      <button id="7">OSD</button>
      <button id="8">ShowVideoMenu</button>
      <button id="9">SkipPrevious</button>
      <button id="10">SkipNext</button>
    </joystick>
  </FullscreenVideo>
</keymap>

Here are my AppleScripts:

Code:
-- volume up by 5
set current_volume to output volume of (get volume settings)

if current_volume is less than 100 then
        set current_volume to (current_volume + 5)
end if

set volume output volume current_volume
beep

Code:
-- volume down by 5
set current_volume to output volume of (get volume settings)

if current_volume is greater than 0 then
        set current_volume to (current_volume - 5)
end if

set volume output volume current_volume
beep

The AppleScript works if I run it from the Applescript editor. I also found that
  1. Relative script paths (e.g., ones with '..' in them) don't seem to work.
  2. If I use "RunScript" instead of "RunAppleScript", XBMC tries to run the scripts as if they were in Python instead of AppleScript.
  3. The fancier scripts that you used to control the volume in an earlier post tended to get stuck if the volume was close, but not quite at one of the volume levels in your "VolumeList" variable.

FYI, I'm trying to use XBMC as an alternative DVD player that actually has readable text at a distance, unlike the default player in OS X. The XBMC version is 11.0 (Git-20120321-14feb09), and my OS version is 10.7.4. I have a Mid 2010 Mac Mini. Here's my latest log, though I doubt it will do much good: http://pastebin.com/E5apr59Z

jjramsey,

Make sure that you are not compiling the Apple Scripts into an executable, leave it as a text file. Also, I noticed you named your volume scripts VolumeUp.scpt and VolumeDown.scpt. I tried using the extension ".scpt" and the scripts did not work. I changed the files back to using the ".applecsript" extension and they worked again. Maybe that is why the relative paths are not working for you. Try changing the extension to ".applescript" and see if that works better. I tried using the RunAppleScript function and that does not work for me that is why I use the function RunScript.

My "fancier" volume script will not work correctly if you start changing the volume using Shirt-Option while pressing the volume key. Apple added Shift-Option-Volume-Key back in OS X 10.7.4 which used to exist in Snow Leopard.
Kodi 17, Transparency Skin
PogoPlug v4 running Arm Linux 4.4.63 as MySQL (mariadb) server.
Mac OS 10.12.5
2015 27" iMac 3.3 GHz Quad, 16GB RAM, 1TB SSD
2015 13" Macbook Pro, 8GB RAM, 256GB SSD
AppleTV 4 TV OS 10
Reply
#9
(2012-06-03, 04:05)winestock Wrote: Make sure that you are compiling the Apple Scripts into an executable, leave it as a text file.
I gather you mean "Make sure that you are not compiling the Apple Scripts into an executable"?

(2012-06-03, 04:05)winestock Wrote: I tried using the extension ".scpt" and the scripts did not work. I changed the files back to using the ".applecsript" extension and they worked again. Maybe that is why the relative paths are not working for you. Try changing the extension to ".applescript" and see if that works better.
I haven't tried the relative paths yet, but changing "RunAppleScript" back to "RunScript" and changing the file extension ".scpt" to ".applescript" worked.

Thank you. Big Grin

Reply
#10
(2012-06-03, 13:26)jjramsey Wrote:
(2012-06-03, 04:05)winestock Wrote: Make sure that you are compiling the Apple Scripts into an executable, leave it as a text file.
I gather you mean "Make sure that you are not compiling the Apple Scripts into an executable"?

(2012-06-03, 04:05)winestock Wrote: I tried using the extension ".scpt" and the scripts did not work. I changed the files back to using the ".applecsript" extension and they worked again. Maybe that is why the relative paths are not working for you. Try changing the extension to ".applescript" and see if that works better.
I haven't tried the relative paths yet, but changing "RunAppleScript" back to "RunScript" and changing the file extension ".scpt" to ".applescript" worked.

Thank you. Big Grin

Glad it is now working for you. I was mistaken about something. My "fancier" Volume Up and Down Apple Scripts do work with the half-volume steps that is now incorporated in 10.7.4. I tested the Apple scripts stand alone and they always changed the volume to the next/previous volume step. Then as a sanity check I set the volume to a half step and then used the Apple remote to raise and lower the volume while the movie was playing. I did this using Eden 11.0.
Kodi 17, Transparency Skin
PogoPlug v4 running Arm Linux 4.4.63 as MySQL (mariadb) server.
Mac OS 10.12.5
2015 27" iMac 3.3 GHz Quad, 16GB RAM, 1TB SSD
2015 13" Macbook Pro, 8GB RAM, 256GB SSD
AppleTV 4 TV OS 10
Reply

Logout Mark Read Team Forum Stats Members Help
How to?: XBMC use and control system volume -lock xbmc internal volume to full 1