info("Trigger") returns button title

info(“Trigger”) returns the button title from the Push Button Options. Is there a way to get the Name entered under Attributes?

Normally, the button’s procedure would be a simple call like

Call "My Procedure"

but you could change that to something like

SetTrigger "MyButtonName"
Call "My Procedure"

or you could have it declare a FileGlobal variable, and put the name in there before the call, or perhaps you could pass the name as a parameter.

When you are setting up the button, you know what name you are giving it. You just have to make the procedure it triggers pass the name to the procedure it calls.

If I understand your request, you might want to check out the info(“clickedobjectname” function.

Dave and Gary’s answers are both correct. I have some further suggestions.

You can use the info(“clickedobjectid”) function to get the object identifier, then use the objectinfo( function to get any attribute of the clicked object. If you only want the name then info(“clickedobjectname”) is simpler, but if you need multiple attributes this allows that.

I’m guessing you want to link multiple buttons to a single procedure, and you want to use the name to alter the behavior of the procedure depending on what button was pressed. You could use the name for that, but you could also use other techniques. For example, you could pass one or more parameters to whatever subroutine you call, like this:

call "My Procedure","button option 1","button option 2"

The procedure can then use the parameter( function to find the information it needs. (Actually, now I see Dave already suggested parameters).