Kodi Community Forum
How to run script from skin? - 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 to run script from skin? (/showthread.php?tid=200054)



How to run script from skin? - elmerohueso - 2014-07-16

I've moved my post to the generic Development forum as I realize it's not strictly speaking skinning.

I know to use <onclick>XBMC.RunScript(path, args)</onclick>, but my problem is with the "path" part.
I'm trying to get my button to execute a script that's bundled with the skin, but I can't figure out the relative/special path (so that it always works, regardless of platform or location).

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, but I can't figure out which folder level that actually points to.


RE: How to run script from skin? - Hitcher - 2014-07-16

Code:
special://skin/

http://wiki.xbmc.org/index.php?title=Special_protocol


RE: How to run script from skin? - elmerohueso - 2014-07-16

(2014-07-16, 20:22)Hitcher Wrote:
Code:
special://skin/

http://wiki.xbmc.org/index.php?title=Special_protocol
I tried special://skin, but I can't figure out what folder level that's pointing to. The wiki says it's the root, but it didn't see my scripts when I put them in the root "myskin" folder. Which folder level does special://skin point to?


RE: How to run script from skin? - Hitcher - 2014-07-16

The root of your skin but your whole structure looks wrong.

Image


RE: How to run script from skin? - ronie - 2014-07-16

i don't think it's possible to include a complete addon in your skin.


RE: How to run script from skin? - elmerohueso - 2014-07-16

(2014-07-16, 22:34)ronie Wrote: i don't think it's possible to include a complete addon in your skin.

Rather, I'm trying to include a skin in my addon. The addon has several scripts, and I'm calling xbmcgui.WindowXMLDialog to display a skin to let the user run the different scripts at will. Sorry I didn't explain that well at the beginning.

I've moved my post to the generic Development forum as I realize it's not strictly speaking skinning.