Getting the current selection
#10
(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'
Reply


Messages In This Thread
Getting the current selection - by jhsrennie - 2012-07-02, 16:53
RE: Getting the current selection - by pieh - 2012-07-03, 10:30
RE: Getting the current selection - by ronie - 2012-09-21, 20:17
RE: Getting the current selection - by LehighBri - 2012-09-21, 20:39
RE: Getting the current selection - by ronie - 2012-09-21, 23:19
RE: Getting the current selection - by Popeye - 2012-11-27, 23:10
RE: Getting the current selection - by belese - 2013-10-10, 16:04
RE: Getting the current selection - by tim619 - 2015-11-07, 02:18
RE: Getting the current selection - by Torben - 2016-04-02, 15:14


Logout Mark Read Team Forum Stats Members Help
Getting the current selection0
This forum uses Lukasz Tkacz MyBB addons.