Kodi Community Forum
How run script once, after skin installation? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: How run script once, after skin installation? (/showthread.php?tid=227650)



How run script once, after skin installation? - roozbehid - 2015-05-22

Is it possible to run script once after installation of the new skin?
I want to run an script to initialize some of skin settings to my defaults....
I found it really hard to go into xml files and change defaults but with running a python script I can easily achieve it....

I found some mentions of startup.xml...but does it only run once by kodi or every time this skin is switched to?


RE: How run script once, after skin installation? - phil65 - 2015-05-22

if you want a script to execute once then just "remember" that by setting a script setting.
You can also do that purely with skinning techniques:
Code:
<include name="Initialization">
        <onload>Skin.SetString(xxx,yyyy)</onload>
    ....
        <onload>Skin.SetBool(init)</onload>
+
Code:
<include condition="!Skin.HasSetting(init)">Initialization</include>