2 Replies Latest reply on Oct 14, 2013 10:21 AM by disabled_rcmiller9

    Getting an object's name.


      Getting an object's name.


           Is there a method of getting an object's name (which will be assigned to a variable) when that object is CLICKED?  Apparently, Get(ActiveLayoutObjectName) will return the name when the object gets focus with a tab; however, I would prefer to use a mouse click to retrieve the name.  Thanks

        • 1. Re: Getting an object's name.

               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.

          • 2. Re: Getting an object's name.

                 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.