2 Replies Latest reply on May 1, 2014 2:46 PM by Mary Posner

    Modal dialog question

    Mary Posner Level 3

      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.

       

      InDesign CS5.5, Mac OX 10.6.8, working on an AppleScript, but I'd also be happy to hear any JavaScript ideas!

       

      Thanks,

       

      Mary

        • 1. Re: Modal dialog question
          Trevorׅ Adobe Community Professional

          Hi Mary

           

          Try some variation of the bellow possibilities and let me know if any of them work

           

          Trevor

           

          tell application "Finder"
              close front window
          end tell
          

          or

           

          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)

          1 person found this helpful
          • 2. Re: Modal dialog question
            Mary Posner Level 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"

                 end tell

                      end tell

            end tell

             

            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.

             

            Mary