I'm working with files that have their assets managed via a DAM that wants the user to log in whenever a file is opened. This log-in window doesn't respect the "script preferences/never interact" direction and pops up with every new file opened in a batch process, requiring the user to dismiss each one so it can go on process each file.
I can see how to check by script whether there's a modal dialog active by checking the modal state, but if that's showing as "true" is there a way via script to target the dialog and dismiss it?
Failing this, I'll have to enforce that users either log into this system or disable the plug-ins, but I was hoping to get something that would require no action on their part other than running the script.
Try some variation of the bellow possibilities and let me know if any of them work
tell application "Finder" close front window end tell
tell application "System Events" tell process "Finder" tell window "Put the name of your window here" click button "name of button" end tell end tell
or instead of click button use something like
keystroke (ASCII character 3)
Hey, Trevor, thanks for the ideas. I'm not quite "there" yet, but I think I'm a little closer. The following works, to a point:
tell application "System Events"
tell process "InDesign"
tell window "User Authentication"
click button 1
-- click button "Cancel"
-- tell button 1 to perform action "AXPress"
Any of those button statements does visibly click that button -- that is, I can see the "Cancel" button flash blue for a moment. But that's all it does. It doesn't actually cancel the dialog.
Since this was for a rush, one-off job, I went with the workaround of telling the user they had to log into the management system so the login screen would stop popping up. It's not elegant, but it gets the job done.
Thanks much for the assistance, I appreciate it.