There are several articles here that address this question, but none offer the help to connect-the-dots.

The attached screen shot shot shows Accessibility Inspector for the button in question, which answers to 'process java'. It also shows the properties of the window (bottom) and 2 code strings to have AppleScript press the continue button. These are:

if exists (button "Continue" of window 1) then
    click button "Continue" of window
else if exists (button "continue" of window 1) then
    click button "continue" of window 1

Click on image to expand

I am almost certain 'tab' and 'space bar' might work for this. But, can it be done through the window? If so, how?

EDIT: Tried to get info about the buttons with:

 get every button of window 1 of process "java"
    --> {button 1 of window "Security Warning" of application process "java",
         button 2 of window "Security Warning" of application process "java",
         button 3 of window "Security Warning" of application process "java"}

It appears the buttons are 'close, zoom & minimize'. (upper left 3 dots)

To get information about UI elements in Accessibility Inspector, you just need to hover the mouse over whichever UI element you want to know more about. For the purposes of closing this security warning, you need to be able to identify which button and which window. So if you hover the mouse over the title bar of the window you can see the AXValue is "Security Warning". And if you hover over the Continue button you can see the AXTitle value is "Continue".

From this you can create the following AppleScript which will close this dialog...

tell application "System Events" to tell process "java"
    click button "Continue" of window "Security Warning"
end tell

Also you can get AppleScript to tell you the actual names of the buttons in the window with. Please note that it will list the three standard Close, Minimise, Maximise traffic light buttons in the top left corner as well.

tell application "System Events" to tell process "java"
    get name of every button of window "Security Warning"
end tell

Hope that helps.

  • The window remains and results in click button "Continue" of window "Security Warning" of process "java" --> error number -1728 from button "Continue" of window "Security Warning" of process "java" – David C Jul 21 '14 at 2:03
  • Are the 'properties' indicating the Security Warning window has NO buttons? (see lower left of image) – David C Jul 21 '14 at 2:05
  • The messages at the bottom left of your screenshot are just saying that the script can't find any buttons called "Continue" or "continue" in window 1. I've updated the answer with another way to find out the button names. – Alistair McMillan Jul 21 '14 at 2:18
  • get name of every button of window "Security Warning" of process "java" --> {missing value, missing value, missing value}. Is it possible the Continue button is in a sub-window? See my edit above. – David C Jul 21 '14 at 2:43
  • 1
    Using 10.8 results in a 'smooth' login.... Time for a bug report. – David C Jul 21 '14 at 16:39

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.