-
-
Notifications
You must be signed in to change notification settings - Fork 15
Script: Creating dialogs
Special characters and commas in arguments can break the called function. To bypass this issue it's required to escape the provided informations by wrapping them into '" "'
.
Example
..&argument='"foo, bar"'&...
..&argument='" / "'&...
..&argument='$ESCINFO[ListItem.Plot]'&...
..&argument='$ESCVAR[MyPlot]'&...
Since Kodi dropped the support for changelog.txt it's a pita to maintain the changelog in addon.xml (keyword: indentation) and a lot of contributers are still using a more detailed changelog.txt. With this function it's possible to open a text file of your choice in the textviewer dialog.
Example call
RunScript(script.embuary.helper,action=txtfile,path=special://skin/changelog.txt,header=$LOCALIZE[24036])
Another option is to store the text file content in a window property instead of using the textviewer dialog. This is useful if you want to compare the content of ListItem.AddonNews and changelog.txt so you are able to only show a changelog.txt button if it differs from the content of the addon.xml.
Creates a context menu with multiple supported actions per item. ||
is used as dividier if more than 1 action should be executed per item. ||
can be replaced by adding an additonal argument called splitby=
. This is useful if you want to combine multiple dialogs, because each one would require a own action divider.
If you want to store the window properties in another window, because you are facing window close/open race conditions, you can add window=home
as argument. Just keep in mind to set the properties to that window, too.
Note: Up to 100 select items are supported.
Example: Regular call
<onclick>SetProperty(Context.1.Label,First element label)</onclick>
<onclick>SetProperty(Context.1.BuiltIn,Skin.String(Foo,bar)</onclick>
<onclick>SetProperty(Context.2.Label,Second element label)</onclick>
<onclick>SetProperty(Context.2.BuiltIn,ClearProperty(Foo,home)||SetProperty(Foo,bar,home)</onclick>
<onclick>RunScript(script.embuary.helper,action=createcontext)</onclick>
Creates a select dialog with multiple supported actions per item. ||
is used as dividier if more than 1 action should be executed per item. ||
can be replaced by adding an additonal argument called splitby=
. This is useful if you want to combine multiple select dialogs, because each one would require a own action divider.
If you want to store the window properties in another window, because you are facing window close/open race conditions, you can add window=home
as argument. Just keep in mind to set the properties to that window, too.
Example: Regular call
Note: Up to 100 select items are supported.
Small select dialog
<onclick>SetProperty(Dialog.1.Label,First element label)</onclick>
<onclick>SetProperty(Dialog.1.BuiltIn,Skin.String(Foo,bar))</onclick>
<onclick>SetProperty(Dialog.2.Label,Second element label)</onclick>
<onclick>SetProperty(Dialog.2.BuiltIn,ActivateWindow(videos)||Notification(Message,Text))</onclick>
<onclick>RunScript(script.embuary.helper,action=createselect,header=This is my heading)</onclick>
Big select dialog with support for ListItem.Icon
<onclick>SetProperty(Dialog.1.Label,First element label,home)</onclick>
<onclick>SetProperty(Dialog.1.Label2,First element label2,home)</onclick>
<onclick>SetProperty(Dialog.1.Icon,First element icon,home)</onclick>
<onclick>SetProperty(Dialog.1.BuiltIn,Skin.String(Foo,bar),home)</onclick>
<onclick>SetProperty(Dialog.2.Label,Second element label,home)</onclick>
<onclick>SetProperty(Dialog.2.Label2,Second element label2,home)</onclick>
<onclick>SetProperty(Dialog.2.Icon,Second element icon,home)</onclick>
<onclick>SetProperty(Dialog.2.BuiltIn,ActivateWindow(videos)||Notification(Message,Text),home)</onclick>
<onclick>RunScript(script.embuary.helper,action=createselect,header=This is my heading,usedetails=true,window=home)</onclick>
Example: Split string and create select dialog based on values
<onclick>SetProperty(Dialog.Builtin,ActivateWindow(videos)++Notification(Foo,Bar)</onclick>
<onclick>RunScript(script.embuary.helper,action=splitandcreateselect,header='"Whatever floats your boat"',items='$ESCINFO[ListItem.Director]',seperator='" / "',splitby='"++"')</onclick>
Opens the text viewer with custom content.
Example call
RunScript(script.embuary.helper,action=textviewer,header=$LOCALIZE[24036],message='$ESCINFO[ListItem.AddonNews]')
Opens the OK dialog with custom content.
Example call
RunScript(script.embuary.helper,action=dialogok,header=$LOCALIZE[24036],message='$ESCINFO[ListItem.AddonNews]')
Opens the Yes/No dialog with custom actions. Multiple actions are possible if they are divided by |
.
Parameters
-
yesaction=
= actions for the "Yes" button -
noaction=
= actions for the "No" button
Example call
RunScript(script.embuary.helper,action=dialogyesno,header=$LOCALIZE[31313],message=$LOCALIZE[31314][CR][CR]$LOCALIZE[31315],yesaction=action1|action2)
script and wiki created by sualfred
- Go to path
- Play item
- Play SFX sound
- Play all, shuffled, from here
- Play folder
- Play random
- Reset container positions
- Browse TV show of episode
- Get TV show details
- Blur image
- Split value
- Check if file exists
- Update library item
- Get .txt file content
- Get system locale
- Set timer
- Encode/decode string
- Calculate
- Get add-on setting
- Image dimension and aspect ratio
- Attention & warning
- Auto font change
- Set Kodi setting
- Get Kodi setting
- Toggle Kodi setting
- Disable/enable add-ons
- The background service
- Restarting the service
- Global background images
- Auto playlist clearing
- Auto refresh widgets
- Player audio track detection
- Player audio and subtitle info labels
- Channel logo of playing recording
- Artist and album artworks for music playback
- Auto fullscreen on playback
- Next item of video playlist
- Player artwork dimension and aspect ratio
- Player icon blurring
- Detect / populate library tags
- In progress media
- Media by random genre
- Get more items of random actor
- Get more items by given actor
- In progress movies
- Suggestions based on watched movies
- Similar movies based on movie
- Movies by random genre
- Movie genres
- Directed by