If you are talking about clicking a button, a mouseclick does not put the focus on the button and make it the active object on your layout. Thus this get function does not work to return the expected object name. The simplest way is to specify the object's name as a script parameter and then you can use Get ( ScriptParameter ) to access the layout object's object name.
Example: you have two buttons with "button 1" and "button 2" as specified object names. Both perform the same script so you need to know which button was clicked to perform the script. You can specify "Button 1" as the script parameter for button 1 and "Button 2" as the script parameter for the second. Then your script can use:
If [ Get ( ScriptParameter ) = "Button 1" // Button 1 was clicked ]
to detect which button was clicked to perform the script.
Thank you, PhilModJunk!
I had read about the Get(ScriptParameter) option in other Posts on this Forum, but I obviously didn't understand it well. I didn't realize that I could assign a different parameter to each object that calls the script. Since I have more than 200 objects that are involved, this method will be save me from creating that many different button scripts. Thanks again.