Assign script to remote key
#1
Sad 
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\\scripts\\tvgids\\tvgids.py')</execute>
</action>
......
</window>

gr,
manoah
Reply
#2
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.
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
#3
Lightbulb 
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
Reply
#4
try:

<execute>xbmc.runscript(f:\apps\xbmc.06.07.05\scripts\tvgids\tvgids.py)</execute>
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#5
thanks nuka1195 for the correction (i should have looked it up rather than just assuming it was correct!Wink

this is all outlined in the online manual at any rate. link is in my sig.
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
#6
Information 
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
Reply
#7
look up (or down now!Wink

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

cheers,
jonathan
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
#8
in manual
Quote: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>
Reply
#9
you need to put a full path in the command.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply

Logout Mark Read Team Forum Stats Members Help
Assign script to remote key0