There is no such function.
In many cases where you might need to capture the object name of an object that you just clicked, you can pass the object name as a script parameter for the script trigger or button setup as a way to get the object name into the script.
And don't forget that you can capture the actual field name of the field with the cursor via Get ( ActiveFieldName ). Your object name may be the same as your field name or something that can be derived from it.
It is really helpful.
Just solve that problem