Is there a way to get the message returned from an application’s alert window? I have searched to no avail. For example, assume Acrobat threw an alert, the alert doesn’t always have a “title” or a window name. So I was hoping there was a way to read the contents within the alert message so I could then determine how the script will behave, i.e., continue after the said alert window is closed or abort the script altogether where this snippet of code resides.
For example, this snippet will display the name of the window. But I was hoping somebody knows how to get the contents of the message itself of window 1? A message such as, “File ‘MyExampleFile.pdf’ was not split because it is already 1 page.”
tell application "System Events"
tell process "Acrobat"
set frontmost to true
set theTitle to title of window 1
display dialog theTitle as string
end tell
end tell