bpy python: is it possible to get the selected collection?
Take a look at this repository, it has a function that could help you, get_active_collection ()
https://github.com/curtisjamesholt/EasyBPY/blob/master/easybpy.py