2021-04-29, 00:54
There is a solution using if else statements in python scripts.
if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)"):
xbmc.executebuiltin("Action(Right)")
time.sleep(0.01)
else:
break
I can directly jump to a bookmarked location (excluding chapters) with a script. Number one jumps to the first bookmarked location. One long press jumps to the eleventh bookmark. Knowing how to compare the ListItem.Label2 (time) to the Player.Time would provide a way to jump to the next bookmark after the current Player.Time. Does anyone know how to make this work?
Some details:
- This should work for any skin with bookmarks in a single horizontal row. I tested it with AeonNoxSilvo.
- <onright> and <onleft> need to be disabled in VideoOSDBookmarks.xml.
- The code below is the script to jump to the second bookmark. The first loop is to return the focused item to the beginning of the list. Perhaps there is a single action to do that?
- The next two loops find the first and second bookmarks (not counting chapters). Nested loops with IF statements were problematic.
- The last loop is for cases where I am seeking beyond the end of the bookmarks and the last list item is a chapter. This loop will go back to the last bookmark that is not a chapter.
import xbmc
import time
xbmc.executebuiltin("ActivateWindow(VideoBookmarks)")
for x in range(50):
xbmc.executebuiltin("Action(Left)")
for x in range(25):
if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)"):
xbmc.executebuiltin("Action(Right)")
time.sleep(0.01)
else:
break
xbmc.executebuiltin("Action(Right)")
time.sleep(0.01)
for x in range(25):
if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)"):
xbmc.executebuiltin("Action(Right)")
time.sleep(0.01)
else:
break
time.sleep(0.1)
for x in range(25):
if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)"):
xbmc.executebuiltin("Action(Left)")
time.sleep(0.01)
else:
break
xbmc.executebuiltin("Action(Select)")
xbmc.executebuiltin("Action(Close)")
if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)"):
xbmc.executebuiltin("Action(Right)")
time.sleep(0.01)
else:
break
I can directly jump to a bookmarked location (excluding chapters) with a script. Number one jumps to the first bookmarked location. One long press jumps to the eleventh bookmark. Knowing how to compare the ListItem.Label2 (time) to the Player.Time would provide a way to jump to the next bookmark after the current Player.Time. Does anyone know how to make this work?
Some details:
- This should work for any skin with bookmarks in a single horizontal row. I tested it with AeonNoxSilvo.
- <onright> and <onleft> need to be disabled in VideoOSDBookmarks.xml.
- The code below is the script to jump to the second bookmark. The first loop is to return the focused item to the beginning of the list. Perhaps there is a single action to do that?
- The next two loops find the first and second bookmarks (not counting chapters). Nested loops with IF statements were problematic.
- The last loop is for cases where I am seeking beyond the end of the bookmarks and the last list item is a chapter. This loop will go back to the last bookmark that is not a chapter.
import xbmc
import time
xbmc.executebuiltin("ActivateWindow(VideoBookmarks)")
for x in range(50):
xbmc.executebuiltin("Action(Left)")
for x in range(25):
if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)"):
xbmc.executebuiltin("Action(Right)")
time.sleep(0.01)
else:
break
xbmc.executebuiltin("Action(Right)")
time.sleep(0.01)
for x in range(25):
if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)"):
xbmc.executebuiltin("Action(Right)")
time.sleep(0.01)
else:
break
time.sleep(0.1)
for x in range(25):
if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)"):
xbmc.executebuiltin("Action(Left)")
time.sleep(0.01)
else:
break
xbmc.executebuiltin("Action(Select)")
xbmc.executebuiltin("Action(Close)")