Hi,
I’m looking for a way to return the current button’s ID as part of a task, which I would then want to apply a right() function to get the last 3 characters and then set the result as a variable to use in visual logic.
Any ideas? It may be kind of a stretch based on another post I saw, but I’ve gotta make a few hundred buttons with some fairly complicated and I wanted to be able to use the button ID (which I have to maintain anyway in order to apply the correct name and style from another script) to feed into a parameter block’s index field.
Thanks!
I, unfortunately, don’t think there’s a way of getting the ID of the button that was just pressed. You could create a variable at the top of the task that has the ID. I know this is duplicating information, but I can’t think of another way right now.
#DashBoard
I think using button parameters might be a better approach to take as you can easily get the selected button’s OID and element number (or selected choice). Still, if you’d like to use the tag, this is how you can get the ID:
function doTheThing(component)
{
ogscript.debug("ID: " + component.getClientProperty('id'));
}
doTheThing(component);
doTheThing(component);
[#DashBoard](https://livinglive.community/search?s=tags%3A%22DashBoard%22&executesearch=true)