2015-03-07, 20:00
Hi!
I want to write a very simple addon to change the audio output via the menu. I already do this with keys from the remote control but I also want to have menu items to change it. Then I will be able to change the audio output via Yatse as well.
My plan is it to set up some other simple scripts as well to du simple tasks.
I read some tutorials and set up a simple script for starters. My question is now how I can use list items to run a python script? It seems that all the listItem classes are only for media content with an URL. How can I do a XBMC.runScript() on a listItem. I got it to work on a contextMenuItem but not with a listItem.
That's my code for now.
Thanks for your help in advance!
I want to write a very simple addon to change the audio output via the menu. I already do this with keys from the remote control but I also want to have menu items to change it. Then I will be able to change the audio output via Yatse as well.
My plan is it to set up some other simple scripts as well to du simple tasks.
I read some tutorials and set up a simple script for starters. My question is now how I can use list items to run a python script? It seems that all the listItem classes are only for media content with an URL. How can I do a XBMC.runScript() on a listItem. I got it to work on a contextMenuItem but not with a listItem.
PHP Code:
import sys
import xbmc
import xbmcgui
import xbmcplugin
addon_handle = int(sys.argv[1])
xbmcplugin.setContent(addon_handle, 'files')
url = 'http://www.orf.at'
li = xbmcgui.ListItem('TEST1', iconImage='DefaultVideo.png')
li.addContextMenuItems([('test6', 'XBMC.runScript(/storage/.kodi/addons/plugin.program.smartcommand/resources/runSetHDMI.py)')])
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)
xbmcplugin.endOfDirectory(addon_handle)
That's my code for now.
Thanks for your help in advance!