Modal Operators: Click Object Event I'm currently working on a python tool using a modal operator.
Now I know to finish the operation I can use:

if event.type == 'LEFTMOUSE':
    return {'FINISHED'}


However it seems not to count as a 'LEFTMOUSE' when I click (select) an object! I also tried 'SELECTMOUSE' which doesn't do anything.

What I would like to do is store the clicked object, and then automatically finish the modal operator.

Any ideas? Thanks in advance!
Why type.event ?

You should get your event.type, and you may want to compare the event.value as well:

def modal(self, context, event):
    if event.type in {"LEFTMOUSE"} and event.value == "RELEASE":
        return {'FINISHED'}
    return {'PASS_THROUGH'}


Also, it might be possible that an event been stop propagate in most of the event handling system. You might need to check the context carefully to see what is the main problem.