0

Is there a way to write a single function to map an object based on the type of control?

For example, I do this for a Yes button:

function YesBtn()  {  return Aliases.[App].Find("MappedName", "*.btnYes", 5, true);  }

Is there a more efficient way to do this so I can find buttons of all types using a single function, rather than mapping each button separately? This is easy enough, but if I can save space and avoid doing this for every single object, I'd prefer to do it that way.

Thank you.

1 Answer 1

0

Assuming your framework makes all the MappedName properties have btn in them, then use that in your wildcard:

function allBtns()  {  return Aliases.[App].Find("MappedName", "*.btn*", 5, true);  }
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, Ed. I tried that, but I ran into a problem where two OK buttons are VisibleOnScreen. For example, a question is displayed in a popup launched from the main window. Is there a way to distinguish between the two with the mapping you recommended?
Respectfully, you asked for "buttons of all types". This gives you that. Are you moving the goalposts? I would have thought the way forward is to accept this (or not), then ask a new question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.