How to determine which collection contains the selected object (highlighted in blue) in outliner?
The screenshot shows the outliner diagram.
The Cube object is in two different collections - Collection 1, Collection 2.
Using LMB I can select the Cube in Collection 1 and leave the object unselected in Collection 2.
How to use Python to determine the collection in which this object is selected?
Because obj.users_collection produces both collections. And I only need one.
Thank you in advance for any help.