Difference between revisions of "Autoexec Service"

From Official Kodi Wiki
Jump to: navigation, search
(Example)
Line 4: Line 4:
  
 
=== Example ===
 
=== Example ===
An example of a autoexec.py is this script that opens up the video files view focused on the root of C:\
+
An example of a autoexec.py is this script that opens up the video files view focused on the root of C:\ when XBMC is started.
  
 
   import xbmc
 
   import xbmc
 
   xbmc.executebuiltin('XBMC.ActivateWindow(videofiles,C:\)')
 
   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)')
  
 
=== References ===
 
=== References ===

Revision as of 12:18, 18 May 2013

Incomplete.png INCOMPLETE:
This page or section is incomplete. Please add information or correct uncertain data which is marked with a ?

1 Description

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

2 Example

An example of a autoexec.py is this script that opens up the video files view focused on the root of C:\ when XBMC 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)')

3 References

Built-in_scripting#Using_Built-in_Functions_from_python

List_of_built-in_functions