Calling script in remote.xml after play pressed issue
#1
Hi all

So I was under the impression that you can add multiple functions to the remote.xml file for each command, play, pause etc. I made the change below but now it's executing the script fine but not performing the preceding function ie play/pause. When I remove the script the play/pause works fine. Any ideas what I'm doing wrong?

Code:
<play>Play</play>
<play>XBMC.RunScript("/home/xbmc/lightsoff.py")</play>
<pause>Pause</pause>
<pause>XBMC.RunScript("/home/xbmc/lightson.py")</pause>

Cheers.
Reply
#2
The key assignments are not cumulative. If you have multiple assignments for a given key in the same or multiple xml files, the last one read is the one that is in effect. Thus, for <play>, the RunScript assignment is in effect because it replaced the Play assignment. If you want to perform multiple functions with a single keypress, you should place those functions in your script. Add this to your lightsoff.py and lightson.py scripts:
Code:
xbmc.executebuiltin( "XBMC.Action(PlayPause)" )
so that PlayPause is executed before running your existing code to turn the lights on or off. Be sure to include xbmc in your import statement if you're not already doing so.

You'd then only need the <play> and <pause> key assignments that run your lightsoff and lightson scripts, respectively.
Reply
#3
Excellent! That worked a treat!

Cheers.
Reply

Logout Mark Read Team Forum Stats Members Help
Calling script in remote.xml after play pressed issue0