User Tools

Site Tools


doc:appunti:software:kodi_execute_script

This is an old revision of the document!


Executing a script from a Kodi plugin add-on

This statement executes a Python script (it must be Python) that resides on the filesystem. The special://home prefix actually refers to the home directory of the Kodi program. In my case it means the /home/kodi/.kodi/ directory.

xbmc.executescript('special://home/bin/my-script.py')

The following example adds a context menu item to a ListItem contained into a plugin directory. Selecting that menu item will will launch the script passing it an argument. Also in this case the script must be a Python script:

li = xbmcgui.ListItem(label='Item title')
li.addContextMenuItems([('Run myScript', 'RunScript(special://home/bin/my-script.py,arg1)')])

Web References

doc/appunti/software/kodi_execute_script.1683305585.txt.gz · Last modified: 2023/05/05 16:53 by niccolo