PDA

View Full Version : Assign script to remote key


manoah
2005-06-10, 10:22
can somebody help me out here? i would like to assign a remote button to execute a python script directly(so from the main menu)
i edited the keymap.xml file, and i know i have got the right code to execute someting when i pres the '1' on my remote. but somehow i won't execute the script directly

this is my keymap.xml entry

<window>
<description>home specific actions</description>
<id>0</id>
<action>
<description>tv gids</description>
<id>0</id>
<remote>1</remote>
<execute>xbmc.executescript('f:\\apps\\xbmc.06.07.05\\scrip ts\\tvgids\\tvgids.py')</execute>
</action>
......
</window>

gr,
manoah

jmarshall
2005-06-10, 13:07
couple of things:

1. you should probably use uppercase on the xbmc, so make it:

xbmc.executescript().

2. you don't need the double \'s - single \'s will do.

manoah
2005-06-11, 20:05
i did all that but no succes what so ever. it only displays the remote number(because i set that option in xboxmediacenter.xml).
it passes the <remote>1</remote> entry, but won't execute this script. the location of the script is correctly

Nuka1195
2005-06-11, 21:36
try:

<execute>xbmc.runscript(f:\apps\xbmc.06.07.05\scripts\tvgid s\tvgids.py)</execute>

jmarshall
2005-06-12, 12:30
thanks nuka1195 for the correction (i should have looked it up rather than just assuming it was correct!)

this is all outlined in the online manual at any rate. link is in my sig.

manoah
2005-06-12, 21:07
yes, great... this works...

one question though. could i have found the answer myself somewhere? because i have search the net for 2 days, but could not find this detail.

once again, thanx guys

jmarshall
2005-06-13, 00:11
look up (or down now!)

if you think it needs more detail added, please feel free to do so.

cheers,
jonathan

smuto
2005-06-13, 14:00
in manual

xbmc.executescript() - runs the python script. you must specify the full path to the script, if it is not in the <scripts> folder from xboxmediacenter.xml

i add <scripts>$home\scripts</scripts> to xboxmediacenter.xml
why this don't work
<execute>xbmc.runscript(tvgids\tvgids.py)</execute>

Nuka1195
2005-06-13, 14:57
you need to put a full path in the command.