2012-09-21, 20:39
(2012-09-21, 20:17)ronie Wrote: i *think* you need to use getFocusId:
Code:win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
curctl = win.getFocusId()
cursel = curctl.getSelectedItem()
Getting closer... but I get an error "AttributeError: 'long' object has no attribute 'getSelectedItem'"
When I use the code below, I get the output below:
Code:
Code:
currentWindow = xbmcgui.Window(xbmcgui.getCurrentWindowId())
print "currentWindow=" + str(currentWindow)
currentControlList = currentWindow.getFocusId()
print "currentControlList=" + str(currentControlList)
selectedListItem = currentControlList.getSelectedItem()
print "selectedListItem=" + str(selectedListItem)
Output:
Code:
14:37:37 T:5568 NOTICE: currentWindow=<xbmcgui.Window object at 0x0C5F8770>
14:37:37 T:5568 NOTICE: currentControlList=504
14:37:37 T:5568 ERROR: Error Type: <type 'exceptions.AttributeError'>
14:37:37 T:5568 ERROR: Error Contents: 'long' object has no attribute 'getSelectedItem'
14:37:37 T:5568 ERROR: Traceback (most recent call last):
File "C:\Users\user\AppData\Roaming\XBMC\addons\plugin.video.sagetv\contextmenuactions.py", line 87, in <module>
selectedListItem = currentControlList.getSelectedItem()
AttributeError: 'long' object has no attribute 'getSelectedItem'