Kodi Community Forum

Full Version: Creating a dialog to run scripts?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to make an addon that has several scripts, and I'm calling xbmcgui.WindowXMLDialog to display a dialog (with buttons, text, and graphics) to let the user run the different scripts at will. I'm using <onclick>XBMC.RunScript(path, args)</onclick> to execute the scipts, and they works great with an absolute path, but I need them to run from a relative path to be platform and location independent.

The structure is as follows:
myskin
-resources
--skins
---default
----720p
-----[skin xml files]
--lib
---[my script files]

What path can I specify in the <onclick> tag that will properly point to the \resources\lib folder?
I've tried special://skin/resources/lib and special://skin/lib, but those don't seem to work. I used special://home and that worked, but it will only work if the addon in in the user folder, not in the install dir (and only if the addon's folder isn't renamed). I want it to work whether installed by a user, or prepackaged in the install dir.

It there an equivalent to xbmcaddon.Addon().getAddonInfo('path') that can be run from the XML to dynamically get the addon's path?