Skin Variables returned by addons?
#1
Hello

I am curious about the process whereby skins retrieve data from external addons?
As an example on the skin i use there is similar info which is provided by "script.skin.helper.widgets" eg:

     <variable name="similarInfo">
        <value condition="!String.IsEmpty(ListItem.IMDBNumber) + String.IsEqual(ListItem.DBTYPE,movie)">plugin://script.skin.helper.widgets/?action=similar&amp;mediatype=movies&amp;imdbid=$INFO[ListItem.IMDBNumber]&amp;limit=12</value>
     </variable>

So i had a look at the skin.helper.widgets for this part and its an actual addon page which is returned, so it makes sense how this would be picked up by the skin (basically as a widget).

But there is a script I would like to create and return some information back to the skin, i figure im probably going to have to populate a window property in my script so the skin can access the information.  Which is fine.

My real query is, if I add my script as a variable somewhere, and call it on a hidden item or something will it be run and populate the window properties whenever the visibility conditions are met?

And/or does it need to be called in a variable, would i be able to add my plugin as an onload condition for the particular screen as all i do is want to populate a couple of window conditions, i dont need an addon list being returned?

Id rather not have to make a service and then trigger the window properties updating somehow, the skins clearly can run addons.  But im not sure what a variable would do if i run a script which doesnt return as an actual addon but just updates a couple of window properties.
Reply
#2
you can indeed run a script (not a plugin!) using  <onload>RunScript(script.myscript)</onload>
that will run your script once, when the window opens.

another way to run a script, is by using a button control, with <onclick>RunScript(script.myscript)</onclick>

and yes, using window properties is very likely to be the easiest way to pass data from an addon to a skin.
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
That's good to know, I've got it running onload and it does what I want. But if the window doesn't unload it doesn't clear and update too well.

Is there a better way to link it to a container property? Like a variable which contains my script to run and linked to a hidden item so if the window now has a new item the script is updating?
Reply

Logout Mark Read Team Forum Stats Members Help
Skin Variables returned by addons?0