Script Command: How to detect a context menu?

How could a script command discover it was called from a (tab) context menu?

There is scriptCmdData.func.fromdrop and scriptCmdData.func.fromkey but detecting the context menu seems tricky.

The idea is to automatically use tab.all instead of tab.selected in the script.

I don't think is a way to know that, but you could solve it more simply by adding an argument to the script command to tell it when to act the other way.