Identify button
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 7
- Joined: Sat Jun 22, 2019 9:19 pm
Identify button
Is it possible to identify a button ID by the icon image ID? Thanks!
Re: Identify button
Hi.
If I understand what you are asking, the "icon" is a property of a button. So if you had, say, ten buttons, and the icon of one of them was, say, "210012", then this would pick it out:
Craig
EDIT: I beat Klaus to virtually the same handler by two minutes.
HAH!
Anyway, he actually answered the OP's question just a tad better, so I updated my original handler by answering the ID instead of the number.
If I understand what you are asking, the "icon" is a property of a button. So if you had, say, ten buttons, and the icon of one of them was, say, "210012", then this would pick it out:
Code: Select all
on mouseUp
repeat with y = 1 to the number of buttons
if the icon of button y = 210012 then
answer the ID of btn y
exit repeat
end repeat
end mouseUp
EDIT: I beat Klaus to virtually the same handler by two minutes.
HAH!
Anyway, he actually answered the OP's question just a tad better, so I updated my original handler by answering the ID instead of the number.
Last edited by dunbarx on Thu Nov 03, 2022 2:39 pm, edited 1 time in total.
Re: Identify button
Sure, with a repeat loop over all the buttons on the current card, see example (or the complete stack if neccessary)
Code: Select all
...
repeat with i = 1 to the num of btns
if the ICON of btn i = your_wanted_id_here then
anwser the ID of btn i
end if
end repeat
...
-
- Posts: 7
- Joined: Sat Jun 22, 2019 9:19 pm
Re: Identify button
Thank you dunbarx and Klaus!