Get Any Button component name

I have 12 buttons named MB1 to MB12 in the designer. In the code I am using the Any button click function which provides the component. However this provides the component type, i.e. com.google.appinventor.components.runtime.Button@123456 not the name of the button.

How can I find out what the button that was clicked is called in the designer?

Thank you

I think, this extension can do it

Taifun

Hi Taifun,

I saw that extension while searching for a solution, but it unfortunately won’t work. It has functions to get all text and all buttons, but it seems i cannot match up a button with a text. If the code is written in such a way that the order of the returned list is always the same it might work. That might need some investigation.

Michael

See this usage example

and check the method GetButtonComponentsByNameSubstring

Taifun