Question

I am trying to give focus to a safari browser modal box and control its input and dismissal.

Example: Navigate to a website, it throws a modal box, is it possible to create an automator workflow or script that will be able to give the modal focus and interact with its content?

TIA,

BK

Was it helpful?

Solution

Try using System Events:

tell application "System Events" to tell process "Safari"
    click button "OK" of window 1
end tell
tell application "System Events" to tell process "Safari"
    set value of text field 1 of window 1 to "aa"
    click button "OK" of window 1
end tell
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top