pass parameters to script executed by keypress
#1
Lightbulb 
I can see it is possible to execute a python script by key press:
http://wiki.xbmc.org/?title=List_of_Built_In_Functions

However I didn't find out how to pass my needed variables to the script. Basically I need the script to receive currently played video (full path and filename) and current position (in seconds or frames).

Is it possible to call a script from XBMC and pass these as parameters? If yes, how could I do that?

Thank you very much for help.
Reply
#2
RunScript(<id>,param1,param2,param3,...) that being said, it won't help you a bit here. you have to use the builtin functions to query those datas.

import xbmc

file = xbmc.Player().getPlayingFile()
position = xbmc.Player().getTime()
Reply
#3
you can use infolabels as parameters when a run a script:
RunScript(script.foo,time=$INFO[Player.Time]&amp;path=$INFO[Player.Path])

this works fine when executing a script from the skin, however i have no idea if this method can also be used when mapping it to a key.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
it can't, that kinda was my point
Reply
#5
Thank you very much, it works.
Reply
#6
Ouch, it seems that if EDL is used to skip certain parts of the movie, the getTime() function returns relative time, as if the movie didn't contain the skipped parts at all.

Is there any function which would return absolute time position including skipped parts by EDL?
Reply
#7
any idea?
Reply

Logout Mark Read Team Forum Stats Members Help
pass parameters to script executed by keypress0