1

Not really sure what its expecting here, I assume its around click button though. This used to work on 10.10.3, but seems to have stopped on 10.10.4?

Script

function AcceptSecurity ()
{
osascript <<EOF
  tell application "System Events"
    repeat while exists (processes where name is "SecurityAgent")
      tell process "SecurityAgent"
        click button "Allow" group 1 of window 1
      end tell
      delay 0.2
    end repeat
  end tell
EOF
}

Exact error 165:170: syntax error: Expected end of line but found class name. (-2741)

2 Answers 2

2

The line

click button "Allow" group 1 of window 1

is missing an ‘of’

click button "Allow" of group 1 of window 1

If the button isn’t in a group, omit the group completely

click button "Allow" of window 1
1

This works

tell process "SecurityAgent" to click button "Allow" of window 1
1
  • I prefer this style for single statements anyway, +1
    – grg
    Commented Mar 25, 2018 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .