How to write AppleScript for clicking an OK button on a custom dialog? I have done a script to quit program:

tell application "Live"
    quit
end tell


…but I get this prompt to click the OK button:



I am running my Mac for schedule shutdown as it is running for an exhibition with unman on/off.

Could someone help me write an AppleScript to click this button?
You might simulate pressing command-Q and return instead:

delay 0.5 -- time to release modifier keys if for example the script is run with command-R
tell application "System Events"
    set frontmost of process "Live" to true
    keystroke "q" using command down
    keystroke return
end tell


Or use ignoring application responses so the quit command doesn't block the script:

delay 0.5
ignoring application responses
    quit application "Live"
end ignoring
delay 1
tell application "System Events" to keystroke return