Kodi Community Forum

Full Version: How to run a script at startup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I"m trying to figure out how to run a script at startup any help on this would be great thanks
<onload>RunScript(skin.mynewskin\myscript.py)</onload>

something like this on the startup.xml file
The same way you run all other scripts:

RunScript(script[,args]*)

Example with skinshortcuts
Code:
<onload>RunScript(script.skinshortcuts,type=buildxml&amp;mainmenuID=99&amp;levels=0&amp;group=mainmenu|shutdown)</onload>

"Runs the python script. You must specify the full path to the script. One way to specify the full path is through the special protocol. If the script is an add-on, you can also execute it using its add-on id. As of 2007/02/24, all extra parameters are passed to the script as arguments and can be accessed by python using sys.argv"

See:
http://kodi.wiki/view/List_of_built-in_functions
http://kodi.wiki/view/Special_protocol