Hey all,
So I’m trying to navigate an internal work site. It has a couple popup windows, and a few disclosure triangles to expand before you are presented with a list of names/checkboxes. I’ve already got a script working to get me to the list. But finding a name in this list and checking the respective box has proven difficult. There are over 1100 rows of names (in alphabetical order if that matters), and my initial proof of concept script was along the lines of:
tell application "System Events"
tell process "Safari"
set frontmost to true
set ManagerName to "Example ManagerName"
repeat with rowNumber from 1 to 1150
try
click static text ManagerName of group 1 of group 2 of group 1 of group rowNumber of group 2 of group 1 of group 2 of group 1 of group 2 of group 12 of group 1 of group 1 of group 6 of group 38 of UI element 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window "Workforce Optimization"
exit repeat
end try
end repeat
end tell
end tell
However, this would take way too long to find people lower down the list. I would hardcode my list in for the row numbers to match, but the row numbers change daily as names are added and removed.
So my next thought was simply CMD F search for the names and then have it take me to the name and I can manually check the box myself. However, for whatever reason the CMD F will find the name on the page, but won’t take you to the result it found; it merely highlights the name that matches and you’ll see it once you scroll down and find it. Is there anyway to have AppleScript scroll down so that the website search result is visible? OR would there be a more reliable way to find the people and check their box? Maybe a way to first dump the list of names so their row number could be found ahead of time?
Any ideas would be greatly appreciated.