List of built-in functions: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
m (→‎List of functions: add color headers for Frodo and Gotham)
(→‎List of functions: aligments, wrapfixes, headers, etc)
Line 21: Line 21:
{{Gotham}}
{{Gotham}}
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
! style="color:#000000; background-color:#DBDBDB; text-align:left;" |'''Function'''
! style="color:#000000; background-color:#DBDBDB; text-align:left;" | '''Description'''
! style="color:#000000; background-color:#DBDBDB; text-align:left;" | '''Version'''
|- valign="top"
| Help
| Help
| This help message
| This help message
|  
|  
|-
|- valign="top"
| Reboot
| Reboot
| Cold reboots the system (power cycle)
| Cold reboots the system (power cycle)
|
|
|-
|- valign="top"
| ShutDown
| ShutDown
| Trigger default Shutdown action defined in System Settings
| Trigger default Shutdown action defined in System Settings
|
|
|-
|- valign="top"
| Powerdown
| Powerdown
| Powerdown system
| Powerdown system
|
|
|-
|- valign="top"
| Quit
| Quit
| Quits XBMC
| Quits XBMC
|
|
|-
|- valign="top"
| Hibernate
| Hibernate
| Hibernate (S4) the System
| Hibernate (S4) the System
|
|
|-
|- valign="top"
| Suspend
| Suspend
| Suspends (S3 / S1 depending on bios setting) the System
| Suspends (S3 / S1 depending on bios setting) the System
|
|
|-{{frodo row}}
|- valign="top" {{frodo row}}
| InhibitIdleShutdown(true/false)
| InhibitIdleShutdown(true/false)
| Prevent the system to shutdown on idle.
| Prevent the system to shutdown on idle.
| '''[[:Category:Frodo feature|12]]'''
| {{nowrap|v12 Addition}}
|-{{frodo row}}
|- valign="top" {{frodo row}}
| AllowIdleShutdown
| AllowIdleShutdown
| Allow the system to shutdown on idle.
| Allow the system to shutdown on idle.
| '''[[:Category:Frodo feature|12]]'''
| {{nowrap|v12 Addition}}
|-{{gotham row}}
|- valign="top" {{gotham row}}
| ActivateScreensaver
| ActivateScreensaver
| Starts the screensaver
| Starts the screensaver
| '''[[:Category:Gotham feature|13]]'''
| {{nowrap|v13 Addition}}
|-
|- valign="top"
| RestartApp
| RestartApp
| Restarts XBMC (not implemented under Win32)
| Restarts XBMC (not implemented under Win32)
|
|
|-
|- valign="top"
| Minimize
| Minimize
| Minimizes XBMC
| Minimizes XBMC
|
|
|-
|- valign="top"
| Reset
| Reset
| Reset the system (same as reboot)
| Reset the system (same as reboot)
|
|
|-
|- valign="top"
| Mastermode
| Mastermode
| Runs XBMC in master mode
| Runs XBMC in master mode
|
|
|- {{gotham row}}
|- valign="top" {{gotham row}}
| SetGUILanguage
| SetGUILanguage
| Set GUI Language
| Set GUI Language
| '''[[:Category:Gotham feature|13]]'''
| {{nowrap|v13 Addition}}
|-
|- valign="top"
| ActivateWindow(window[,dir,return])
| ActivateWindow(window[,dir,return])
| Opens the given window. The parameter window can either be the window's id, or in the case of a standard window, the window's name. [[Window IDs|See here for a list of window names, and their respective ids.]] If, furthermore, the window is Music, Video, Pictures, or Program files, then the optional dir parameter specifies which folder XBMC should default to once the window is opened. This must be a source as specified in sources.xml, or a subfolder of a valid source. For some windows (MusicLibrary and VideoLibrary), the return parameter may be specified, which indicates that XBMC should use this folder as the "root" of the level, and thus the "parent directory" action from within this folder will return the user to where they were prior to the window activating.
| Opens the given window. The parameter window can either be the window's id, or in the case of a standard window, the window's name. [[Window IDs|See here for a list of window names, and their respective ids.]] If, furthermore, the window is Music, Video, Pictures, or Program files, then the optional dir parameter specifies which folder XBMC should default to once the window is opened. This must be a source as specified in sources.xml, or a subfolder of a valid source. For some windows (MusicLibrary and VideoLibrary), the return parameter may be specified, which indicates that XBMC should use this folder as the "root" of the level, and thus the "parent directory" action from within this folder will return the user to where they were prior to the window activating.
|
|
|-{{frodo row}}
|- valign="top" {{frodo row}}
| ActivateWindowAndFocus(id1, id2,item1, id3,item2)
| ActivateWindowAndFocus(id1, id2,item1, id3,item2)
| Activate window with id1, first focus control id2 and then focus control id3. if either of the controls is a container, you can specify which item to focus (else, set it to 0).
| Activate window with id1, first focus control id2 and then focus control id3. if either of the controls is a container, you can specify which item to focus (else, set it to 0).
| '''[[:Category:Frodo feature|12]]'''
| {{nowrap|v12 Addition}}
|-
|- valign="top"
| ReplaceWindow(window,dir)
| ReplaceWindow(window,dir)
| Replaces the current window with the given window. This is the same as ActivateWindow() but it doesn't update the window history list, so when you go back from the new window it will not return to the previous window, rather will return to the previous window's previous window.
| Replaces the current window with the given window. This is the same as ActivateWindow() but it doesn't update the window history list, so when you go back from the new window it will not return to the previous window, rather will return to the previous window's previous window.
|
|
|-{{gotham row}}
|- valign="top" {{gotham row}}
| ReplaceWindowAndFocus(id1, id2,item1, id3,item2)
| ReplaceWindowAndFocus(id1, id2,item1, id3,item2)
| Replace window with id1, first focus control id2 and then focus control id3.  if either of the controls is a container, you can specify which item to focus (else, set it to 0).
| Replace window with id1, first focus control id2 and then focus control id3.  if either of the controls is a container, you can specify which item to focus (else, set it to 0).
| '''[[:Category:Gotham feature|13]]'''
| {{nowrap|v13 Addition}}
|-
|- valign="top"
| TakeScreenshot
| TakeScreenshot
| Takes a Screenshot
| Takes a Screenshot
|
|
|-
|- valign="top"
| RunScript(script[,args]*)
| RunScript(script[,args]*)
| Runs the python script. You must specify the full path to the script. If the script is an add-on, you can also execute it using its add-on id. As of 2007/02/24, all extra parameters are passed to the script as arguments and can be accessed by python using sys.argv
| Runs the python script. You must specify the full path to the script. If the script is an add-on, you can also execute it using its add-on id. As of 2007/02/24, all extra parameters are passed to the script as arguments and can be accessed by python using sys.argv
|
|
|-{{frodo row}}
|- valign="top" {{frodo row}}
| StopScript(id)
| StopScript(id)
| Stop the script by ID or path, if running
| Stop the script by ID or path, if running
| 12
| {{nowrap|v12 Addition}}
|-
|- valign="top"
| RunAppleScript(script[,args]*)
| RunAppleScript(script[,args]*)
| Run the specified AppleScript command
| Run the specified AppleScript command
|
|
|-
|- valign="top"
| RunPlugin(plugin)
| RunPlugin(plugin)
| Runs the plugin. Full path must be specified. Does not work for folder plugins
| Runs the plugin. Full path must be specified. Does not work for folder plugins
|
|
|-
|- valign="top"
| RunAddon(id)
| RunAddon(id)
| Runs the specified plugin/script
| Runs the specified plugin/script
|
|
|-{{gotham row}}
|- valign="top" {{gotham row}}
| NotifyAll
| NotifyAll
| Notify all connected clients
| Notify all connected clients
| '''[[:Category:Gotham feature|13]]'''
| {{nowrap|v13 Addition}}
|-
|- valign="top"
| Extract
| Extract
| Extracts a specified archive to an optionally specified path. <font color="red">! REQUIRES ABSOLUTE PATHS !</font>
| Extracts a specified archive to an optionally specified 'absolute' path.  
|
|
|-
|- valign="top"
| PlayMedia(media[,isdir][,1],[playoffset=xx])
| PlayMedia(media[,isdir][,1],[playoffset=xx])
| Plays the media. This can be a playlist, music, or video file, directory, plugin or an Url. The optional parameter ",isdir" can be used for playing a directory. ",1" will start a video in a preview window, instead of fullscreen. If media is a playlist, you can use playoffset=xx where xx is the position to start playback from.
| Plays the media. This can be a playlist, music, or video file, directory, plugin or an Url. The optional parameter ",isdir" can be used for playing a directory. ",1" will start a video in a preview window, instead of fullscreen. If media is a playlist, you can use playoffset=xx where xx is the position to start playback from.
|
|
|-
|- valign="top"
| SlideShow(dir [,recursive, [not]random])
| SlideShow(dir [,recursive, [not]random])
| Starts a slideshow of pictures in the folder dir.  Optional parameters are "recursive", and "random" or "notrandom" parameters.  The "recursive" parameter starts a recursive slideshow, adding images from sub-folders.  The "random" and "notrandom" parameters override the Randomize setting found in the pictures media window.
| Starts a slideshow of pictures in the folder dir.  Optional parameters are "recursive", and "random" or "notrandom" parameters.  The "recursive" parameter starts a recursive slideshow, adding images from sub-folders.  The "random" and "notrandom" parameters override the Randomize setting found in the pictures media window.
|
|
|-
|- valign="top"
| RecursiveSlideShow(dir)
| RecursiveSlideShow(dir)
| Run a slideshow from the specified directory, including all subdirs
| Run a slideshow from the specified directory, including all subdirs
|
|
|-
|- valign="top"
| ReloadSkin()
| ReloadSkin()
| Reloads the current skin – useful for Skinners to use after they upload modified skin files (saves power cycling)
| Reloads the current skin – useful for Skinners to use after they upload modified skin files (saves power cycling)
|
|
|-
|- valign="top"
| UnloadSkin()
| UnloadSkin()
| Unloads the current skin
| Unloads the current skin
|
|
|-
|- valign="top"
| RefreshRSS
| RefreshRSS
| Reload RSS feeds from RSSFeeds.xml
| Reload RSS feeds from RSSFeeds.xml
|
|
|-
|- valign="top"
| PlayerControl(command)
| PlayerControl(command)
| Allows control of music and videos. The command may be one of Play, Stop, Forward, Rewind, Next, Previous, BigSkipForward, BigSkipBackward, SmallSkipForward, SmallSkipBackward, Random, RandomOn, RandomOff, Repeat, RepeatOne, RepeatAll, RepeatOff, Partymode(music) or Partymode(video) or Partymode(path to .xsp file), and Record. Play will either pause, resume, or stop ffwding or rewinding.  Random toggles random playback and Repeat cycles through the repeat modes (these both take an optional second parameter, Notify, that notifies the user of the new state). Partymode(music/video) toggles the appropriate partymode, defaults to music if no parameter is given, besides the default music or video partymode you can also pass a path to a custom smartplaylist (.xsp) as parameter.
| Allows control of music and videos. The command may be one of Play, Stop, Forward, Rewind, Next, Previous, BigSkipForward, BigSkipBackward, SmallSkipForward, SmallSkipBackward, Random, RandomOn, RandomOff, Repeat, RepeatOne, RepeatAll, RepeatOff, Partymode(music) or Partymode(video) or Partymode(path to .xsp file), and Record. Play will either pause, resume, or stop ffwding or rewinding.  Random toggles random playback and Repeat cycles through the repeat modes (these both take an optional second parameter, Notify, that notifies the user of the new state). Partymode(music/video) toggles the appropriate partymode, defaults to music if no parameter is given, besides the default music or video partymode you can also pass a path to a custom smartplaylist (.xsp) as parameter.
|
|
|-
|- valign="top"
| Playlist.PlayOffset
| Playlist.PlayOffset
| Start playing from a particular offset in the playlist
| Start playing from a particular offset in the playlist
|
|
|-
|- valign="top"
| Playlist.Clear
| Playlist.Clear
| Clear the current playlist
| Clear the current playlist
|
|
|-
|- valign="top"
| EjectTray()
| EjectTray()
| Either opens or closes the DVD tray, depending on its current state
| Either opens or closes the DVD tray, depending on its current state
|
|
|-
|- valign="top"
| AlarmClock(name,command,time[,silent,loop])
| AlarmClock(name,command,time[,silent,loop])
| Pops up a dialog asking for the length of time for the alarm (unless the parameter time is specified), and starts a timer. When the timer runs out, it'll execute the <span class="nobr">built-in</span> command (the parameter command) if it is specified, otherwise it'll pop up an alarm notice. Add silent to hide the alarm notification. Add loop for the alarm to execute the command each time the specified time interval expires.
| Pops up a dialog asking for the length of time for the alarm (unless the parameter time is specified), and starts a timer. When the timer runs out, it'll execute the <span class="nobr">built-in</span> command (the parameter command) if it is specified, otherwise it'll pop up an alarm notice. Add silent to hide the alarm notification. Add loop for the alarm to execute the command each time the specified time interval expires.
|
|
|-
|- valign="top"
| CancelAlarm(name[,silent])
| CancelAlarm(name[,silent])
| Cancel a running alarm. Set silent to true to hide the alarm notification.  
| Cancel a running alarm. Set silent to true to hide the alarm notification.  
|
|
|-
|- valign="top"
| Action
| Action
| Executes an action for the active window (same as in keymap)
| Executes an action for the active window (same as in keymap)
|
|
|-
|- valign="top"
| Notification(header,message[,time,image])
| Notification(header,message[,time,image])
| Will display a notification dialog with the specified header and message, in addition you can set the length of time it displays in milliseconds and a icon image.
| Will display a notification dialog with the specified header and message, in addition you can set the length of time it displays in milliseconds and a icon image.
|
|
|-
|- valign="top"
| PlayDVD
| PlayDVD
| Will play the inserted CD or DVD media from the <span class="nobr">DVD-ROM</span> drive.
| Will play the inserted CD or DVD media from the <span class="nobr">DVD-ROM</span> drive.
|
|
|-
|- valign="top"
| RipCD
| RipCD
| Will rip the inserted CD from the <span class="nobr">DVD-ROM</span> drive.
| Will rip the inserted CD from the <span class="nobr">DVD-ROM</span> drive.
|
|
|-
|- valign="top"
| Skin.ToggleSetting(setting)
| Skin.ToggleSetting(setting)
| Toggles the skin setting ?setting? for use with [[Conditional Visibility|conditional visibility tags]] containing Skin.HasSetting(setting).
| Toggles the skin setting ?setting? for use with [[Conditional Visibility|conditional visibility tags]] containing Skin.HasSetting(setting).
|
|
|-
|- valign="top"
| Skin.SetString(string[,value])
| Skin.SetString(string[,value])
| Pops up a keyboard dialog and allows the user to input a string which can be used in a label control elsewhere in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the value parameter is specified, then the keyboard dialog does not pop up, and the string is set directly.
| Pops up a keyboard dialog and allows the user to input a string which can be used in a label control elsewhere in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the value parameter is specified, then the keyboard dialog does not pop up, and the string is set directly.
|
|
|-
|- valign="top"
| Skin.SetNumeric(numeric[,value])
| Skin.SetNumeric(numeric[,value])
| Pops up a keyboard dialog and allows the user to input a numerical.
| Pops up a keyboard dialog and allows the user to input a numerical.
|
|
|-
|- valign="top"
| Skin.SetPath(string[,value])
| Skin.SetPath(string[,value])
| Pops up a folder browser and allows the user to select a folder of images  to be used in a multi image control else where in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the path is set directly.
| Pops up a folder browser and allows the user to select a folder of images  to be used in a multi image control else where in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the path is set directly.
|
|
|-
|- valign="top"
| Skin.Theme
| Skin.Theme
| Cycles the skin theme. Skin.theme(-1) will go backwards.
| Cycles the skin theme. Skin.theme(-1) will go backwards.
|
|
|-
|- valign="top"
| Skin.SetImage(string[,value])
| Skin.SetImage(string[,value])
| Pops up a file browser and allows the user to select an image file to be used in an image control elsewhere in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the image path is set directly.
| Pops up a file browser and allows the user to select an image file to be used in an image control elsewhere in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the image path is set directly.
|
|
|-
|- valign="top"
| Skin.SetLargeImage(string[,value])
| Skin.SetLargeImage(string[,value])
| Pops up a file browser and allows the user to select an large image file to be used in an image control else where in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the image path is set directly.
| Pops up a file browser and allows the user to select an large image file to be used in an image control else where in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the image path is set directly.
|
|
|-
|- valign="top"
| Skin.SetFile(string,mask,folderpath)
| Skin.SetFile(string,mask,folderpath)
| Pops up a folder browser and allows the user to select a file off the hard-disk to be used else where in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the mask parameter is specified, then the file browser will only search for the extension specified (.avi,.mp3,.m3u,.png,.bmp,etc.,etc.). To use multiple extensions separate them using "|" minus quotes. If the folderpath parameter is set the file browser will start in that folder.
| Pops up a folder browser and allows the user to select a file off the hard-disk to be used else where in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the mask parameter is specified, then the file browser will only search for the extension specified (.avi,.mp3,.m3u,.png,.bmp,etc.,etc.). To use multiple extensions separate them using "|" minus quotes. If the folderpath parameter is set the file browser will start in that folder.
|
|
|-
|- valign="top"
| Skin.SetAddon(string,type)
| Skin.SetAddon(string,type)
| Pops up a select dialog and allows the user to select an add-on of the given type to be used elsewhere in the skin via the info tag Skin.String(string). The most common types are ''xbmc.addon.video'', ''xbmc.addon.audio'', ''xbmc.addon.image'' and ''xbmc.addon.executable''.
| Pops up a select dialog and allows the user to select an add-on of the given type to be used elsewhere in the skin via the info tag Skin.String(string). The most common types are ''xbmc.addon.video'', ''xbmc.addon.audio'', ''xbmc.addon.image'' and ''xbmc.addon.executable''.
|
|
|-
|- valign="top"
| Skin.SetBool(setting)
| Skin.SetBool(setting)
| Sets the skin setting ?setting? to true, for use with the [[Conditional Visibility|conditional visibility tags]] containing Skin.HasSetting(setting). The settings are saved <span class="nobr">per-skin</span> in settings.xml just like all the other XBMC settings.
| Sets the skin setting ?setting? to true, for use with the [[Conditional Visibility|conditional visibility tags]] containing Skin.HasSetting(setting). The settings are saved <span class="nobr">per-skin</span> in settings.xml just like all the other XBMC settings.
|
|
|-
|- valign="top"
| Skin.Reset(setting)
| Skin.Reset(setting)
| Resets the skin setting ?setting?. If ?setting? is a bool setting (i.e. set via SetBool or ToggleSetting) then the setting is reset to false. If ?setting? is a string (Set via SetString, SetImage, or SetPath) then it is set to empty.
| Resets the skin setting ?setting?. If ?setting? is a bool setting (i.e. set via SetBool or ToggleSetting) then the setting is reset to false. If ?setting? is a string (Set via SetString, SetImage, or SetPath) then it is set to empty.
|
|
|-
|- valign="top"
| Skin.ResetSettings
| Skin.ResetSettings
| Resets all the above skin settings to their defaults (toggles all set to false, strings all set to empty.)
| Resets all the above skin settings to their defaults (toggles all set to false, strings all set to empty.)
|
|
|-
|- valign="top"
| Mute
| Mute
| Mutes (or unmutes) the volume.
| Mutes (or unmutes) the volume.
|
|
|-
|- valign="top"
| SetVolume(percent[,showvolumebar])
| SetVolume(percent[,showvolumebar])
| Sets the volume to the percentage specified. Optionally, show the Volume Dialog in XBMC when setting the volume.
| Sets the volume to the percentage specified. Optionally, show the Volume Dialog in XBMC when setting the volume.
|
|
|-
|- valign="top"
| Dialog.Close(dialog[,force])
| Dialog.Close(dialog[,force])
| Close a dialog. Set force to true to bypass animations. Use (all,true) to close all opened dialogs at once.
| Close a dialog. Set force to true to bypass animations. Use (all,true) to close all opened dialogs at once.
|
|
|-
|- valign="top"
| System.LogOff
| System.LogOff
| Log off current user.
| Log off current user.
|
|
|-
|- valign="top"
| System.Exec
| System.Exec
| Execute shell commands.
| Execute shell commands.
|
|
|-
|- valign="top"
| System.ExecWait
| System.ExecWait
| Execute shell commands and freezes XBMC until shell is closed.
| Execute shell commands and freezes XBMC until shell is closed.
|
|
|-
|- valign="top"
| Resolution
| Resolution
| Change XBMC's Resolution.
| Change XBMC's Resolution.
|
|
|-
|- valign="top"
| SetFocus(id,position)
| SetFocus(id,position)
| Will make a list with the "id" specified in the command gain focus at "position" number in its list. Alias SetFocus(id,position)
| Will make a list with the "id" specified in the command gain focus at "position" number in its list. Alias SetFocus(id,position)
|
|
|-
|- valign="top"
| UpdateLibrary(database,[path])
| UpdateLibrary(database,[path])
| Takes either "video" or "music" as a parameter to begin updating the corresponding database. For "video" you can additionally specify a specific path to be scanned.
| Takes either "video" or "music" as a parameter to begin updating the corresponding database. For "video" you can additionally specify a specific path to be scanned.
|
|
|-
|- valign="top"
| CleanLibrary(database)
| CleanLibrary(database)
| This funtion will perform a number of 'cleanup' tasks on your video database and can be run if you have moved, deleted or renamed files. Takes either "video" or "music" as a parameter to begin cleaning the corresponding database.
| This funtion will perform a number of 'cleanup' tasks on your video database and can be run if you have moved, deleted or renamed files. Takes either "video" or "music" as a parameter to begin cleaning the corresponding database.
|
|
|-
|- valign="top"
| exportlibrary(music,false,filepath)
| exportlibrary(music,false,filepath)
| The music library will be exported to a single file stored at filepath location.
| The music library will be exported to a single file stored at filepath location.
|
|
|-
|- valign="top"
| exportlibrary(video,true,thumbs,overwrite,actorthumbs)
| exportlibrary(video,true,thumbs,overwrite,actorthumbs)
| The video library is exported to multiple files with the given options. Here thumbs, overwrite and actorthumbs are boolean values (true or false).
| The video library is exported to multiple files with the given options. Here thumbs, overwrite and actorthumbs are boolean values (true or false).
|
|
|-
|- valign="top"
| PageDown
| PageDown
| Send a page down event to the pagecontrol with given id.
| Send a page down event to the pagecontrol with given id.
|
|
|-
|- valign="top"
| PageUp
| PageUp
| Send a page up event to the pagecontrol with given id.
| Send a page up event to the pagecontrol with given id.
|
|
|-{{gotham row}}
|- valign="top" {{gotham row}}
| <s>LastFM.Love</s>
| <s>LastFM.Love</s>
| <s>All songs that can be submitted to Last.fm can be loved, optional parameter (false) = direct loving without confirmationdialog.</s>  
| <s>All songs that can be submitted to Last.fm can be loved, optional parameter (false) = direct loving without confirmationdialog.</s>  
(removed in Gotham)
| {{nowrap|v13 Removal}}
| '''[[:Category:Gotham feature|13]]'''
|- valign="top" {{gotham row}}
|-{{gotham row}}
| <s>LastFM.Ban</s>
| <s>LastFM.Ban</s>
| <s>Only songs that are playing on last.fm radio can be banned, optional parameter (false) = direct banning without confirmationdialog.</s>  
| <s>Only songs that are playing on last.fm radio can be banned, optional parameter (false) = direct banning without confirmationdialog.</s>  
(removed in Gotham)
| {{nowrap|v13 Removal}}
| '''[[:Category:Gotham feature|13]]'''
|- valign="top"
|-
| Container.Refresh
| Container.Refresh
| Refresh current listing.
| Refresh current listing.
|
|
|-
|- valign="top"
| Container.Update
| Container.Update
| Update current listing. Send Container.Update(path,replace) to reset the path history.
| Update current listing. Send Container.Update(path,replace) to reset the path history.
|
|
|-
|- valign="top"
| Container.NextViewMode
| Container.NextViewMode
| Select the next view mode.
| Select the next view mode.
|
|
|-
|- valign="top"
| Container.PreviousViewMode
| Container.PreviousViewMode
| Select the previous view mode.
| Select the previous view mode.
|
|
|-
|- valign="top"
| Container.SetViewMode(id)
| Container.SetViewMode(id)
| Set the current view mode (list, icons etc.) to the given container id.
| Set the current view mode (list, icons etc.) to the given container id.
|
|
|-
|- valign="top"
| Container.NextSortMethod
| Container.NextSortMethod
| Change to the next sort method.
| Change to the next sort method.
|
|
|-
|- valign="top"
| Container.PreviousSortMethod
| Container.PreviousSortMethod
| Change to the previous sort method.
| Change to the previous sort method.
|
|
|-
|- valign="top"
| Container.SetSortMethod
| Container.SetSortMethod
| Change to the specified sort method.
| Change to the specified sort method.
|
|
|-
|- valign="top"
| Container.SortDirection
| Container.SortDirection
| Toggle the sort direction.
| Toggle the sort direction.
|
|
|-
|- valign="top"
| Control.Move(id,offset)
| Control.Move(id,offset)
| Will make a Container with the "id" specified in the command move focus by "offset".
| Will make a Container with the "id" specified in the command move focus by "offset".
|
|
|-
|- valign="top"
| Control.SetFocus(id,position)
| Control.SetFocus(id,position)
| Will make a list with the "id" specified in the command gain focus at "position" number in its list. Alias SetFocus(id,position)
| Will make a list with the "id" specified in the command gain focus at "position" number in its list. Alias SetFocus(id,position)
|
|
|-
|- valign="top"
| Control.Message(id,message,[windowid])
| Control.Message(id,message,[windowid])
| Sends a given message to a control in a given window (or active window if omitted). Messages can be movedown, moveup, pagedown, pageup, click.
| Sends a given message to a control in a given window (or active window if omitted). Messages can be movedown, moveup, pagedown, pageup, click.
|
|
|-
|- valign="top"
| SendClick(windowid,id)
| SendClick(windowid,id)
| Sends a click to a control in a given window (or active window if omitted).
| Sends a click to a control in a given window (or active window if omitted).
|
|
|-
|- valign="top"
| LoadProfile(profilename,[prompt])
| LoadProfile(profilename,[prompt])
| Load the specified profile. If prompt is not specified, and a password would be required for the requested profile, this command will silently fail. If promp' is specified and a password is required, a password dialog will be shown.
| Load the specified profile. If prompt is not specified, and a password would be required for the requested profile, this command will silently fail. If promp' is specified and a password is required, a password dialog will be shown.
|
|
|-
|- valign="top"
| SetProperty(key,value[,id])
| SetProperty(key,value[,id])
| Sets a window property for the current window (key,value), or the specified window (key,value,id).
| Sets a window property for the current window (key,value), or the specified window (key,value,id).
|
|
|-
|- valign="top"
| ClearProperty(key[,id])
| ClearProperty(key[,id])
| Clears a window property for the current focused window/dialog(key), or the specified window (key,id).
| Clears a window property for the current focused window/dialog(key), or the specified window (key,id).
|
|
|-
|- valign="top"
| PlayWith()
| PlayWith()
| Play the selected item with the specified player core.
| Play the selected item with the specified player core.
|
|
|-
|- valign="top"
| WakeOnLan(mac)
| WakeOnLan(mac)
| Sends the wake-up packet to the broadcast address for the specified MAC address (Format: FF:FF:FF:FF:FF:FF or FF-FF-FF-FF-FF-FF).
| Sends the wake-up packet to the broadcast address for the specified MAC address (Format: FF:FF:FF:FF:FF:FF or FF-FF-FF-FF-FF-FF).
|
|
|-{{gotham row}}
|- valign="top" {{gotham row}}
| <s>LCD.Suspend</s>
| <s>LCD.Suspend</s>
| <s>Suspends LCDproc.</s> (removed in Gotham)
| <s>Suspends LCDproc.</s>
| '''[[:Category:Gotham feature|13]]'''
| {{nowrap|v13 Removal}}
|-{{gotham row}}
|- valign="top" {{gotham row}}
| <s>LCD.Resume</s>
| <s>LCD.Resume</s>
| <s>Resumes LCDproc.</s> (removed in Gotham)
| <s>Resumes LCDproc.</s>
| '''[[:Category:Gotham feature|13]]'''
| {{nowrap|v13 Removal}}
|-
|- valign="top"
| Addon.Default.OpenSettings
| Addon.Default.OpenSettings
| Open a settings dialog for the default addon of the given type
| Open a settings dialog for the default addon of the given type
|
|
|-
|- valign="top"
| Addon.Default.Set
| Addon.Default.Set
| Open a select dialog to allow choosing the default addon of the given type
| Open a select dialog to allow choosing the default addon of the given type
|
|
|-
|- valign="top"
| Addon.OpenSettings(id)
| Addon.OpenSettings(id)
| Open a settings dialog for the addon of the given id
| Open a settings dialog for the addon of the given id
|
|
|-
|- valign="top"
| UpdateAddonRepos
| UpdateAddonRepos
| Triggers a forced update of enabled add-on repositories.
| Triggers a forced update of enabled add-on repositories.
|
|
|-
|- valign="top"
| UpdateLocalAddons
| UpdateLocalAddons
| Triggers a scan of local add-on directories.
| Triggers a scan of local add-on directories.
|
|
|-
|- valign="top"
| ToggleDPMS
| ToggleDPMS
| Toggle DPMS mode manually
| Toggle DPMS mode manually
|
|
|-{{gotham row}}
|- valign="top" {{gotham row}}
| CECToggleState
| CECToggleState
| Toggle state of playing device via a CEC peripheral
| Toggle state of playing device via a CEC peripheral
| '''[[:Category:Gotham feature|13]]'''
| {{nowrap|v13 Addition}}
|-{{gotham row}}
|- valign="top" {{gotham row}}
| CECActivateSource
| CECActivateSource
| Wake up playing device via a CEC peripheral
| Wake up playing device via a CEC peripheral
| '''[[:Category:Gotham feature|13]]'''
| {{nowrap|v13 Addition}}
|-{{gotham row}}
|- valign="top" {{gotham row}}
| CECStandby
| CECStandby
| Put playing device on standby via a CEC peripheral
| Put playing device on standby via a CEC peripheral
| '''[[:Category:Gotham feature|13]]'''
| {{nowrap|v13 Addition}}
|-
|- valign="top"
| Weather.Refresh
| Weather.Refresh
| Force weather data refresh
| Force weather data refresh
|
|
|-
|- valign="top"
| Weather.LocationNext
| Weather.LocationNext
| Switch to next weather location
| Switch to next weather location
|
|
|-
|- valign="top"
| Weather.LocationPrevious
| Weather.LocationPrevious
| Switch to previous weather location
| Switch to previous weather location
|
|
|-
|- valign="top"
| Weather.LocationSet
| Weather.LocationSet
| Switch to given weather location (parameter can be 1-3)
| Switch to given weather location (parameter can be 1-3)
|
|
|-
|- valign="top"
| LIRC.Stop
| LIRC.Stop
| Removes XBMC as a LIRC client.
| Removes XBMC as a LIRC client.
|
|
|-
|- valign="top"
| LIRC.Start
| LIRC.Start
| Adds XBMC as a LIRC client.
| Adds XBMC as a LIRC client.
|
|
|-
|- valign="top"
| LIRC.Send(command)
| LIRC.Send(command)
| Sends a command to LIRC, syntax is the lirc protocol without the newline.<br />Example: LIRC.Send(SEND_ONCE Onkyo_RC-453S2 volup)
| Sends a command to LIRC, syntax is the lirc protocol without the newline.<br />Example: LIRC.Send(SEND_ONCE Onkyo_RC-453S2 volup)
|
|
|-
|- valign="top"
| VideoLibrary.Search
| VideoLibrary.Search
| Brings up a search dialog which will search the library
| Brings up a search dialog which will search the library
|
|
|-{{frodo row}}
|- valign="top" {{frodo row}}
| ToggleDebug
| ToggleDebug
| Enables/disables debug mode
| Enables/disables debug mode
| '''[[:Category:Frodo feature|12]]'''
| {{nowrap|v12 Addition}}
|-{{frodo row}}
|- valign="top" {{frodo row}}
| StartPVRManager
| StartPVRManager
| (Re)Starts the PVR manager
| (Re)Starts the PVR manager
| '''[[:Category:Frodo feature|12]]'''
| {{nowrap|v12 Addition}}
|-{{frodo row}}
|- valign="top" {{frodo row}}
| StopPVRManager
| StopPVRManager
| Stops the PVR manager
| Stops the PVR manager
| '''[[:Category:Frodo feature|12]]'''
| {{nowrap|v12 Addition}}
|-{{gotham row}}
|- valign="top" {{gotham row}}
| StartAndroidActivity
| {{nowrap|StartAndroidActivity(package,[intent,dataType,dataURI])}}
(package,[intent,dataType,dataURI])
| Launch an Android native app with the given package name.  Optional parms (in order): intent, dataType, dataURI.
| Launch an Android native app with the given package name.  Optional parms (in order): intent, dataType, dataURI.
| '''[[:Category:Gotham feature|13]]'''
| {{nowrap|v13 Addition}}
|-{{gotham row}}
|- valign="top" {{gotham row}}
| SetStereoMode
| SetStereoMode
| Changes the stereo mode of the GUI. Params can be: toggle, next, previous, select, tomono or any of the supported stereomodes (off, split_vertical, split_horizontal, row_interleaved, hardware_based, anaglyph_cyan_red, anaglyph_green_magenta, monoscopic)
| Changes the stereo mode of the GUI. Params can be: toggle, next, previous, select, tomono or any of the supported stereomodes (off, split_vertical, split_horizontal, row_interleaved, hardware_based, anaglyph_cyan_red, anaglyph_green_magenta, monoscopic)
| '''[[:Category:Gotham feature|13]]'''
| {{nowrap|v13 Addition}}
|}
|}



Revision as of 14:52, 19 February 2014

Home icon grey.png   ▶ Development ▶ Add-on development ▶ List of built-in functions

Skins can use built-in functions with the <onclick> or <onfocus> tag. Scripts can call built-in functions with xbmc.executebuiltin(function, block).

The latest up-to-date list of built-in functions can be found in the function CBuiltins::Execute() in the source code file xbmc/interfaces/Builtins.cpp.

In addition to the following list, for most <onclick> and <onfocus> button actions in the skin you can also use the functions from Keyboard.xml.

Example:
<onclick>VolumeUp</onclick>
<onclick>VolumeDown</onclick>

You can use parameters with all media windows, as can be seen here:

List of functions

Template:Frodo Template:Gotham

Function Description Version
Help This help message
Reboot Cold reboots the system (power cycle)
ShutDown Trigger default Shutdown action defined in System Settings
Powerdown Powerdown system
Quit Quits XBMC
Hibernate Hibernate (S4) the System
Suspend Suspends (S3 / S1 depending on bios setting) the System
InhibitIdleShutdown(true/false) Prevent the system to shutdown on idle. v12 Addition
AllowIdleShutdown Allow the system to shutdown on idle. v12 Addition
ActivateScreensaver Starts the screensaver v13 Addition
RestartApp Restarts XBMC (not implemented under Win32)
Minimize Minimizes XBMC
Reset Reset the system (same as reboot)
Mastermode Runs XBMC in master mode
SetGUILanguage Set GUI Language v13 Addition
ActivateWindow(window[,dir,return]) Opens the given window. The parameter window can either be the window's id, or in the case of a standard window, the window's name. See here for a list of window names, and their respective ids. If, furthermore, the window is Music, Video, Pictures, or Program files, then the optional dir parameter specifies which folder XBMC should default to once the window is opened. This must be a source as specified in sources.xml, or a subfolder of a valid source. For some windows (MusicLibrary and VideoLibrary), the return parameter may be specified, which indicates that XBMC should use this folder as the "root" of the level, and thus the "parent directory" action from within this folder will return the user to where they were prior to the window activating.
ActivateWindowAndFocus(id1, id2,item1, id3,item2) Activate window with id1, first focus control id2 and then focus control id3. if either of the controls is a container, you can specify which item to focus (else, set it to 0). v12 Addition
ReplaceWindow(window,dir) Replaces the current window with the given window. This is the same as ActivateWindow() but it doesn't update the window history list, so when you go back from the new window it will not return to the previous window, rather will return to the previous window's previous window.
ReplaceWindowAndFocus(id1, id2,item1, id3,item2) Replace window with id1, first focus control id2 and then focus control id3. if either of the controls is a container, you can specify which item to focus (else, set it to 0). v13 Addition
TakeScreenshot Takes a Screenshot
RunScript(script[,args]*) Runs the python script. You must specify the full path to the script. If the script is an add-on, you can also execute it using its add-on id. As of 2007/02/24, all extra parameters are passed to the script as arguments and can be accessed by python using sys.argv
StopScript(id) Stop the script by ID or path, if running v12 Addition
RunAppleScript(script[,args]*) Run the specified AppleScript command
RunPlugin(plugin) Runs the plugin. Full path must be specified. Does not work for folder plugins
RunAddon(id) Runs the specified plugin/script
NotifyAll Notify all connected clients v13 Addition
Extract Extracts a specified archive to an optionally specified 'absolute' path.
PlayMedia(media[,isdir][,1],[playoffset=xx]) Plays the media. This can be a playlist, music, or video file, directory, plugin or an Url. The optional parameter ",isdir" can be used for playing a directory. ",1" will start a video in a preview window, instead of fullscreen. If media is a playlist, you can use playoffset=xx where xx is the position to start playback from.
SlideShow(dir [,recursive, [not]random]) Starts a slideshow of pictures in the folder dir. Optional parameters are "recursive", and "random" or "notrandom" parameters. The "recursive" parameter starts a recursive slideshow, adding images from sub-folders. The "random" and "notrandom" parameters override the Randomize setting found in the pictures media window.
RecursiveSlideShow(dir) Run a slideshow from the specified directory, including all subdirs
ReloadSkin() Reloads the current skin – useful for Skinners to use after they upload modified skin files (saves power cycling)
UnloadSkin() Unloads the current skin
RefreshRSS Reload RSS feeds from RSSFeeds.xml
PlayerControl(command) Allows control of music and videos. The command may be one of Play, Stop, Forward, Rewind, Next, Previous, BigSkipForward, BigSkipBackward, SmallSkipForward, SmallSkipBackward, Random, RandomOn, RandomOff, Repeat, RepeatOne, RepeatAll, RepeatOff, Partymode(music) or Partymode(video) or Partymode(path to .xsp file), and Record. Play will either pause, resume, or stop ffwding or rewinding. Random toggles random playback and Repeat cycles through the repeat modes (these both take an optional second parameter, Notify, that notifies the user of the new state). Partymode(music/video) toggles the appropriate partymode, defaults to music if no parameter is given, besides the default music or video partymode you can also pass a path to a custom smartplaylist (.xsp) as parameter.
Playlist.PlayOffset Start playing from a particular offset in the playlist
Playlist.Clear Clear the current playlist
EjectTray() Either opens or closes the DVD tray, depending on its current state
AlarmClock(name,command,time[,silent,loop]) Pops up a dialog asking for the length of time for the alarm (unless the parameter time is specified), and starts a timer. When the timer runs out, it'll execute the built-in command (the parameter command) if it is specified, otherwise it'll pop up an alarm notice. Add silent to hide the alarm notification. Add loop for the alarm to execute the command each time the specified time interval expires.
CancelAlarm(name[,silent]) Cancel a running alarm. Set silent to true to hide the alarm notification.
Action Executes an action for the active window (same as in keymap)
Notification(header,message[,time,image]) Will display a notification dialog with the specified header and message, in addition you can set the length of time it displays in milliseconds and a icon image.
PlayDVD Will play the inserted CD or DVD media from the DVD-ROM drive.
RipCD Will rip the inserted CD from the DVD-ROM drive.
Skin.ToggleSetting(setting) Toggles the skin setting ?setting? for use with conditional visibility tags containing Skin.HasSetting(setting).
Skin.SetString(string[,value]) Pops up a keyboard dialog and allows the user to input a string which can be used in a label control elsewhere in the skin via the info tag Skin.String(string). If the value parameter is specified, then the keyboard dialog does not pop up, and the string is set directly.
Skin.SetNumeric(numeric[,value]) Pops up a keyboard dialog and allows the user to input a numerical.
Skin.SetPath(string[,value]) Pops up a folder browser and allows the user to select a folder of images to be used in a multi image control else where in the skin via the info tag Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the path is set directly.
Skin.Theme Cycles the skin theme. Skin.theme(-1) will go backwards.
Skin.SetImage(string[,value]) Pops up a file browser and allows the user to select an image file to be used in an image control elsewhere in the skin via the info tag Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the image path is set directly.
Skin.SetLargeImage(string[,value]) Pops up a file browser and allows the user to select an large image file to be used in an image control else where in the skin via the info tag Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the image path is set directly.
Skin.SetFile(string,mask,folderpath) Pops up a folder browser and allows the user to select a file off the hard-disk to be used else where in the skin via the info tag Skin.String(string). If the mask parameter is specified, then the file browser will only search for the extension specified (.avi,.mp3,.m3u,.png,.bmp,etc.,etc.). To use multiple extensions separate them using "|" minus quotes. If the folderpath parameter is set the file browser will start in that folder.
Skin.SetAddon(string,type) Pops up a select dialog and allows the user to select an add-on of the given type to be used elsewhere in the skin via the info tag Skin.String(string). The most common types are xbmc.addon.video, xbmc.addon.audio, xbmc.addon.image and xbmc.addon.executable.
Skin.SetBool(setting) Sets the skin setting ?setting? to true, for use with the conditional visibility tags containing Skin.HasSetting(setting). The settings are saved per-skin in settings.xml just like all the other XBMC settings.
Skin.Reset(setting) Resets the skin setting ?setting?. If ?setting? is a bool setting (i.e. set via SetBool or ToggleSetting) then the setting is reset to false. If ?setting? is a string (Set via SetString, SetImage, or SetPath) then it is set to empty.
Skin.ResetSettings Resets all the above skin settings to their defaults (toggles all set to false, strings all set to empty.)
Mute Mutes (or unmutes) the volume.
SetVolume(percent[,showvolumebar]) Sets the volume to the percentage specified. Optionally, show the Volume Dialog in XBMC when setting the volume.
Dialog.Close(dialog[,force]) Close a dialog. Set force to true to bypass animations. Use (all,true) to close all opened dialogs at once.
System.LogOff Log off current user.
System.Exec Execute shell commands.
System.ExecWait Execute shell commands and freezes XBMC until shell is closed.
Resolution Change XBMC's Resolution.
SetFocus(id,position) Will make a list with the "id" specified in the command gain focus at "position" number in its list. Alias SetFocus(id,position)
UpdateLibrary(database,[path]) Takes either "video" or "music" as a parameter to begin updating the corresponding database. For "video" you can additionally specify a specific path to be scanned.
CleanLibrary(database) This funtion will perform a number of 'cleanup' tasks on your video database and can be run if you have moved, deleted or renamed files. Takes either "video" or "music" as a parameter to begin cleaning the corresponding database.
exportlibrary(music,false,filepath) The music library will be exported to a single file stored at filepath location.
exportlibrary(video,true,thumbs,overwrite,actorthumbs) The video library is exported to multiple files with the given options. Here thumbs, overwrite and actorthumbs are boolean values (true or false).
PageDown Send a page down event to the pagecontrol with given id.
PageUp Send a page up event to the pagecontrol with given id.
LastFM.Love All songs that can be submitted to Last.fm can be loved, optional parameter (false) = direct loving without confirmationdialog. v13 Removal
LastFM.Ban Only songs that are playing on last.fm radio can be banned, optional parameter (false) = direct banning without confirmationdialog. v13 Removal
Container.Refresh Refresh current listing.
Container.Update Update current listing. Send Container.Update(path,replace) to reset the path history.
Container.NextViewMode Select the next view mode.
Container.PreviousViewMode Select the previous view mode.
Container.SetViewMode(id) Set the current view mode (list, icons etc.) to the given container id.
Container.NextSortMethod Change to the next sort method.
Container.PreviousSortMethod Change to the previous sort method.
Container.SetSortMethod Change to the specified sort method.
Container.SortDirection Toggle the sort direction.
Control.Move(id,offset) Will make a Container with the "id" specified in the command move focus by "offset".
Control.SetFocus(id,position) Will make a list with the "id" specified in the command gain focus at "position" number in its list. Alias SetFocus(id,position)
Control.Message(id,message,[windowid]) Sends a given message to a control in a given window (or active window if omitted). Messages can be movedown, moveup, pagedown, pageup, click.
SendClick(windowid,id) Sends a click to a control in a given window (or active window if omitted).
LoadProfile(profilename,[prompt]) Load the specified profile. If prompt is not specified, and a password would be required for the requested profile, this command will silently fail. If promp' is specified and a password is required, a password dialog will be shown.
SetProperty(key,value[,id]) Sets a window property for the current window (key,value), or the specified window (key,value,id).
ClearProperty(key[,id]) Clears a window property for the current focused window/dialog(key), or the specified window (key,id).
PlayWith() Play the selected item with the specified player core.
WakeOnLan(mac) Sends the wake-up packet to the broadcast address for the specified MAC address (Format: FF:FF:FF:FF:FF:FF or FF-FF-FF-FF-FF-FF).
LCD.Suspend Suspends LCDproc. v13 Removal
LCD.Resume Resumes LCDproc. v13 Removal
Addon.Default.OpenSettings Open a settings dialog for the default addon of the given type
Addon.Default.Set Open a select dialog to allow choosing the default addon of the given type
Addon.OpenSettings(id) Open a settings dialog for the addon of the given id
UpdateAddonRepos Triggers a forced update of enabled add-on repositories.
UpdateLocalAddons Triggers a scan of local add-on directories.
ToggleDPMS Toggle DPMS mode manually
CECToggleState Toggle state of playing device via a CEC peripheral v13 Addition
CECActivateSource Wake up playing device via a CEC peripheral v13 Addition
CECStandby Put playing device on standby via a CEC peripheral v13 Addition
Weather.Refresh Force weather data refresh
Weather.LocationNext Switch to next weather location
Weather.LocationPrevious Switch to previous weather location
Weather.LocationSet Switch to given weather location (parameter can be 1-3)
LIRC.Stop Removes XBMC as a LIRC client.
LIRC.Start Adds XBMC as a LIRC client.
LIRC.Send(command) Sends a command to LIRC, syntax is the lirc protocol without the newline.
Example: LIRC.Send(SEND_ONCE Onkyo_RC-453S2 volup)
VideoLibrary.Search Brings up a search dialog which will search the library
ToggleDebug Enables/disables debug mode v12 Addition
StartPVRManager (Re)Starts the PVR manager v12 Addition
StopPVRManager Stops the PVR manager v12 Addition
StartAndroidActivity(package,[intent,dataType,dataURI]) Launch an Android native app with the given package name. Optional parms (in order): intent, dataType, dataURI. v13 Addition
SetStereoMode Changes the stereo mode of the GUI. Params can be: toggle, next, previous, select, tomono or any of the supported stereomodes (off, split_vertical, split_horizontal, row_interleaved, hardware_based, anaglyph_cyan_red, anaglyph_green_magenta, monoscopic) v13 Addition