Passing a Button or Button Bar Object Name

Has anyone figured out how to get the object name of a button when it is clicked or when its associated script runs?

Hi, have you try the following method?

https://community.claris.com/en/s/question/0D50H00007iq5G3SAI/get-object-name-after-clicking-on-a-button-instead-of-entering-the-field

1 Like

Roundabout way but it works. Thanks!

You would think that the button would be accessible via Get(ActiveLayoutObjectName) but that function returns empty. It's an annoying side-effect of the need to retain state within the layout, such as the position of the cursor in a field, when a button is clicked.

Claris could help by providing us with some more tools for interacting with buttons and panels.

2 Likes

I submitted an idea a few years back. As every object in FM has a unique, never to be reused ID, each object should have an associated default object name. This would save the step of manually having to name objects in order to reference them. The ability to custom change the object default name would still be retained so the cryptic object-name-by-reference-ID could be changed for readability, but having a default unique name would be useful.

And as FM already has unique IDs for every object today, the transition might be light lifting.

1 Like

Those name would the be something like TextBox1, TestBox2. etc. This is the kind of object names I don't use, I prefer using meaningful names like FisrtName and LastName. When looking at a script you know which data you are manipulating.

They already "name" them things like "Panel", but are not persistent named objects. "Panel_143" would be useful - the numeric object ID is already there under the covers - and I could always rename it if needed to have a more memorable name.