Difference between revisions of "Autoexec Service"

From Official Kodi Wiki
Jump to: navigation, search
m (Robot: Changing Category:XBMC Manual to Category:Manual)
m (Bot: Automated text replacement (- XBMC + Kodi ))
Line 1: Line 1:
 
{{cleanup}}
 
{{cleanup}}
<section begin="intro" />autoexec.py is an optional python script that users can create in their [[userdata]] folders that will be executed when XBMC starts up.<section end="intro" />
+
<section begin="intro" />autoexec.py is an optional python script that users can create in their [[userdata]] folders that will be executed when Kodi starts up.<section end="intro" />
  
 
== Examples ==
 
== Examples ==
This script will open up the video files view focused on the root of C:\ when XBMC is started.
+
This script will open up the video files view focused on the root of C:\ when Kodi is started.
 
   import xbmc
 
   import xbmc
 
   xbmc.executebuiltin('XBMC.ActivateWindow(videofiles,C:\)')
 
   xbmc.executebuiltin('XBMC.ActivateWindow(videofiles,C:\)')

Revision as of 08:26, 4 May 2015

Cleanup.png This page or section may require cleanup, updating, spellchecking, reformatting and/or updated images. Please improve this page if you can. The discussion page may contain suggestions.

autoexec.py is an optional python script that users can create in their userdata folders that will be executed when Kodi starts up.

1 Examples

This script will open up the video files view focused on the root of C:\ when Kodi is started.

 import xbmc
 xbmc.executebuiltin('XBMC.ActivateWindow(videofiles,C:\)')

Here is an example that starts your favourite addon:

 import xbmc
 xbmc.executebuiltin('XBMC.RunScript(script.audio.spotimc)')

And this example takes you to the movie overview:

 import xbmc
 xbmc.executebuiltin('XBMC.ActivateWindow(myvideolibrary,movietitles)')

2 References

Built-in scripting#Using Built-in Functions from python

List of built-in functions