How can I detect which menu my item was invoked from? Just give them all different IDs. But this might itself by an XY problem. Click here to read the article