I am scripting iTunes and have bumped into two problems when I in one step of my script need to verify wether windows/dialogs are displayed or not.
According to Waiting until a window exists in Applescript? this should be valid code
repeat until window "Print" of process "Evernote" exists
but when I compile it I get this error message "Expected end of line but found “"” (" refers to the " before E in Evernote). Why? That question is 2,5 years old, has anything changed since then? I am running OS X 10.11.
I can use this code to verify wether the song info-window is open in iTunes
repeat until (not (exists window "Song Info"))
but when I try to look for en Open dialog with a similar line
repeat until (exists window "Open")
the window is not detected. I have used Accessibility Inspector to get some properties of the Song Info window and the Open dialog and the only differences I have noticed is the name as well as the type. Song Info is a "window" while Open is a "dialog". Hence, I also tried these two variations on the previous code:
repeat until (exists dialog "Open") repeat until (exists window dialog "Open") repeat until (exists dialog window "Open")
but none of them compile.
How do I detect the Open dialog?