Kodi Community Forum
How can I start a script from a remote button? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+--- Thread: How can I start a script from a remote button? (/showthread.php?tid=64356)



How can I start a script from a remote button? - cewan - 2009-12-17

Hello!
I would like to know how I can start a script by pressing a button on my remote?
I have tried to search the forums and the wiki, but did not find the information.

I know a little about changing remote.xml, as I have earlier successfully managed to start playback of a playlist by adding:
<zero>XBMC.PlayMedia(<path to m3u file>)</zero>

I cannot, however, find the right command for starting a script.

More specifically I would like to add a button to start the XOT-uzg script: http://www.rieter.net/uitzendinggemist/

Can anyone help me?

BR


- amet - 2009-12-17

cewan Wrote:Hello!
I would like to know how I can start a script by pressing a button on my remote?
I have tried to search the forums and the wiki, but did not find the information.

I know a little about changing remote.xml, as I have earlier successfully managed to start playback of a playlist by adding:
<zero>XBMC.PlayMedia(<path to m3u file>)</zero>

I cannot, however, find the right command for starting a script.

More specifically I would like to add a button to start the XOT-uzg script: http://www.rieter.net/uitzendinggemist/

Can anyone help me?

BR

this should work:
Quote:<zero>XBMC.RunScript(path to default.py)</zero>


obviously change <zero> to whatever button you like

Zeljko


- mccorkled - 2009-12-18

I tried this code with the Theater Experience script and I didnt get it working.

I think its my path to the script. This is what I have...
<w>XBMC.RunScript(C:\Users\HTPC\AppData\Roaming\XBMC\scripts\Home Theater Experience\default.py)</w>

Also tried it with...
<w>XBMC.RunScript(C:\Program Files (x86)\XBMC\Scripts\Home Theater Experience\default.py)</w>

whats the deal?


- amet - 2009-12-18

mccorkled Wrote:I tried this code with the Theater Experience script and I didnt get it working.

I think its my path to the script. This is what I have...
<w>XBMC.RunScript(C:\Users\HTPC\AppData\Roaming\XBMC\scripts\Home Theater Experience\default.py)</w>

Also tried it with...
<w>XBMC.RunScript(C:\Program Files (x86)\XBMC\Scripts\Home Theater Experience\default.py)</w>

whats the deal?



try:

Quote:xbmc.runscript(special://home/scripts/Home Theater Experience/default.py

it works like this on OSX and ATV(different script), also the path you specify must be correct.

Zeljko


- mccorkled - 2009-12-18

alright. ill give this a try. It seems that this code will only work running in portable mode because if your not, the plugins wont work in, special://home/scripts/

thanks though. Ill give it a whirl


- Nuka1195 - 2009-12-18

running from a key action you will not queue the movie. so i don't think this will work.


- amet - 2009-12-18

Nuka1195 Wrote:running from a key action you will not queue the movie. so i don't think this will work.

not too familiar with the script, was explaining how to map it to the button Smile


- Nuka1195 - 2009-12-18

what would be nice is:

Code:
<zero>
  <action>Action(Queue,25)</action>
  <action>xbmc.runscript(special://home/scripts/Home Theater Experience/default.py)</action>
</zero>

the code will work as long as you remember to clear the queue, then queue the movie. not what he's looking for i would think.

i see the op, was not discussing the hte script.


- spiff - 2009-12-18

why? you can just have the script queue up the item for you.


- Nuka1195 - 2009-12-18

doh, that would work even better as it can determine the active window instead of hard coding 25.

thanks