v17 Invoking Runscript
#1
Are there restrictions on where you can invoke Runscript, and if so where are they documented?
I'm trying to invoke a script at various points in the MyVideoNav window without success.
Before going into detail I'd like to know whether it's even possible :-}
The skin I'm using is Xonfluence, but I'm not sure that's relevant yet.
TIA for any pointers.
Reply
#2
i don't think there are any technical limitations, no.
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
#3
Thanks for replying.
I say 'not working' because the Python method I'm trying to invoke writes to the Kodi log, and I see nothing there.
If I call a method with deliberately incorrect parameters, I get this in the log

16:33:29 25342.855469 T:1958490112 ERROR: Misplaced [
16:33:29 25342.855469 T:1958490112 ERROR: Error parsing boolean expression RunScript(script.videoextras,check,"$INFO[ListItem.FilenameAndPath]")

so at least I know Kodi is trying to call it. [There is no ListItem at this point].
This is not the method I want to call, I just tried it instead of my own because I know it works :-}
Stumped.
Reply
#4
you shouldn't put quotes around the $INFO[] part.
also if you need to pass multiple args, i think you need separate them by & instead of a comma.

i usually use something like this to invoke a script:
Code:
RunScript(script.playalbum,method=play&albumid=$INFO[ListItem.DBID])
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
#5
Hmmm. The call syntax I used works OK in an <onload> tag for a window [where the ListItem was previously defined].
I can't get it to work anywhere else [regardless of syntax, mine or yours as above] :-{
I've tried as a condition in <visible>, as the value in <onfocus>.
What I'm trying to do is to get hold of the ListItem displayed in the various views in MyVideoNav, so I can set some additional info.
Any ideas ? TIA.
Reply
#6
well, RunScript() is an action, not a boolean, so you can't use it in a <visible> condition.

one option would be to run your script from the context menu, by making it available as a context menu addon.
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
#7
Ah, that explains a number of things, thanks.
It's a bit chicken and egg - I want to set some ListItem infos that can be read by context menu addons !
The idea of using <onfocus> came from here http://forum.kodi.tv/showthread.php?tid=288767.
Apparently worked for the OP there, but not for me :-{
Any suggestions as to where else I could invoke Runscript ?
TIA.
Reply

Logout Mark Read Team Forum Stats Members Help
Invoking Runscript0