19 Replies Latest reply on Apr 29, 2013 4:17 AM by Peter Spier

    How Stop Indesign message using script ?

    Bill joy Level 1

      Hi Experts,

      I want to stop to prompt indesign message.

      For example

      I close Indesign application without saving the document using Quit on MAC OS.

      When next time I start indesign application It prompt a message dialog.

      Do you want to start automatic recovery?

      Click Yes to begin recovery.

      Click No to delete recovery data for all documents.

      Click Cancel to postpone all document recovery until later.

       

      Another message dialog message is:

      NewFile.indd could not be found. Do you want to postpone its recovery?

      Click Yes...............................

      Click No.....................

      Click Cancel.....................

       

      I want to stop to prompt this type of message.

       

      Is it possible using script ?

       

      My problem is I start Indesign Application using #target indesign and want to create a document.

      But document is not created untill this type of message is available.

       

      How give responce this type of messge using script automatically Yes,No or Cancel ?

       

      I want, when i create a document using script and this type of message is prompt then automatically ( using script) kill this dialog or give Yes, No or Cancel and then create document file.

       

       

      Thanks.

        • 1. Re: How Stop Indesign message using script ?
          TᴀW Adobe Community Professional & MVP

          You should ask this sort of question in the Scripting forum.

           

          You're looking for this, I think:

           

               app.scriptPreferences.userInteractionLevel =

          UserInteractionLevels.NEVER_INTERACT;

           

          Just make sure that at the end of your script, you set it back:

           

               app.scriptPreferences.userInteractionLevel =

          UserInteractionLevels.INTERACT_WITH_ALL;

           

           

          Ariel

          • 2. Re: How Stop Indesign message using script ?
            Peter Spier Most Valuable Participant (Moderator)

            Bill joy wrote:

            I close Indesign application without saving the document using Quit on MAC OS.

            Well, I think you really mean you use force quit, or don't close your open files first, because the messages you are talking about only come up if you don't close ID properly. The best way to not see those messages is to be sure files and the application close as they are meant to do.

            • 3. Re: How Stop Indesign message using script ?
              Mary Posner Level 3

              Ditto what Ariel said, you'll find the right audience for this question in the scripting forum.

               

              I wouldn't recommend starting InDesign via script, for exactly the kind of issue you're having. You can't turn off interaction until after the application is running, and by then it's already thrown the messages you mention above. Is there some reason you can't run your script *after* you've launched InDesign?

              • 4. Re: How Stop Indesign message using script ?
                Peter Spier Most Valuable Participant (Moderator)

                Maybe I'm misunderstanding something, but I don't see why starting ID from a script would automatically bring up messages about recovery unless there was recovery data, and there shold not be any recovery data unless ID was shut down improperly.

                 

                Perhaps this is really old recovery data that is no longer relevant, in which case emptying the InDesign Recovery folder should solve the problem.

                1 person found this helpful
                • 5. Re: How Stop Indesign message using script ?
                  Bill joy Level 1

                  Thanks to All for reply

                  Hi Ariel I try as You told me

                   

                  #target indesign

                  app.scriptPreferences.userInteractionLevel=UserInteractionLevels.NEVER_INTERACT;

                  app.documents.add();

                   

                  But it also prompt message.

                  Screen shot 2013-04-15 at 9.21.38 AM.png

                   

                  How stop these prompted message ?

                  Or how I can give 'No' responce to these meassge using script ?

                   

                  I do not want to recver any previous file.

                  I want to create a new file without prompt these type of message.

                   

                  How solve this problem ?

                   

                  Thanks.

                  • 6. Re: How Stop Indesign message using script ?
                    Bill joy Level 1

                    Hi Peter thanks for reply

                    Is there is no any scripting method to stop these message ?

                    I do not want to recover any previous file.

                    I only want to start InDesign and create new file without prompt these message.

                     

                    I do not find any Application property or method in Object Model to stop these message or give answer of these message using script.

                     

                     

                    Thanks.

                    • 7. Re: How Stop Indesign message using script ?
                      Bill joy Level 1

                      Hi Ariel

                      I try using Apple script also

                       

                      tell application "Adobe InDesign CS5.5"

                      set user interaction level of script preferences to never interact

                      end tell

                       

                      AppleScript Error

                      Adobe InDesign CS5.5 got an error : Cannot handel the request because a model dialog or alert is active.

                       

                      How stop these allert message ?

                      • 8. Re: How Stop Indesign message using script ?
                        Peter Spier Most Valuable Participant (Moderator)

                        The way to sptop the message, as far as I know, is to have nothing to recover, but I'm not a scripter. As I said initially, these messages should only pop up when ID is shut down imporoperely, leaving recovery data behind, and the best way to stop that is to be sure all files are closed correctly.

                        • 9. Re: How Stop Indesign message using script ?
                          Bill joy Level 1

                          Thanks Peter for reply

                          I know  that best way to stop these message is all files are closed correctly.

                          My problem is that  In  my application (on MAC OS) when InDesign run and anyone close InDesign with (Force Quit) from Dock Then after this if I want to create InDesign using script :

                           

                          #target indesign

                          app.documents.add();

                          then document is not create because a model dialog or alert is active.

                          I want that this model dialog or alert is not popup.

                          or

                          If there is no way to stop this message then how give answer of this message using script.

                           

                          Thanks

                          • 10. Re: How Stop Indesign message using script ?
                            Bill joy Level 1

                            Hi Peter

                            I try

                            #target indesign

                            if(app.modalState)

                            {

                            alert("Model or Alert dialog is open");

                            }

                             

                            But second line is not run untill dialog is not closed.

                             

                            Is there is any property which is use with #target indesign  like :

                            #target indesign

                            with();

                             

                            Thanks.

                            • 11. Re: How Stop Indesign message using script ?
                              MW Design Level 4

                              Seems foolish to quit applications without properly exiting it, but different strokes for different folks...

                               

                              How about in your script:

                               

                              1. Set it to delete anything in the recovery folder if found.
                              2. Exit ID and answer no to saving a file
                              3. Add a function key to run the script

                               

                              You would need to use a key combination to shut down ID in this manner, but ID would at least be shutting down properly.

                               

                              Good luck.

                              • 12. Re: How Stop Indesign message using script ?
                                Bill joy Level 1

                                Thanks MikeWenzloff for quick reply

                                 

                                Can you give me example

                                to add a function key or a key combination to shut down Id.

                                 

                                Thanks.

                                • 13. Re: How Stop Indesign message using script ?
                                  MW Design Level 4

                                  Sorry, but no.

                                   

                                  Have you asked this in the scripting forum? Or try searching in the scripting forum?

                                   

                                  First you need to write the javascript to listen for the app closing. Then you need to add code to tell ID not to save anything. Then perhaps to clean the recovery folder, and finally exit. Once that is working, can you not assign a hot key combination to fire off the script?

                                   

                                  Mike

                                  • 14. Re: How Stop Indesign message using script ?
                                    Peter Spier Most Valuable Participant (Moderator)

                                    I definitely think you should be asking these questions in the Scripting forum: InDesign Scripting

                                     

                                    I suspect you could create a startup script that would run in the background to watch for close events, but If ID is force quit, I don't know that it would be able to finish running and clear the recovery folder. I'm not at all convinced this would be a good idea anyway. Auto recovery is, to me at least, one of the most powerful and important features in ID, and one I need from time to time -- some files do occasionally crash, after all, and you don't want to automatically throw away something valuable that could be recovered. We even rely on it here on the forum when solving problems for users who find themselves unable to save a file for unknown reasons.

                                     

                                    If you have users who routinely force quit, they need to be retrained. This is a USER problem, not a scripting problem.

                                    • 15. Re: How Stop Indesign message using script ?
                                      rob day Adobe Community Professional & MVP

                                      The recover dialog you are showing appears during the launch of InDesign when any document(s) hasn't been properly saved—maybe you've lost a connection to the file's server and had to force quit in order to get ID working?

                                       

                                      Setting the user interaction to never won't work because ID has to be launched before you can set the interaction via scripting.

                                       

                                      If you were able to find a way to disable the dialog you would then no longer be able to recover  work lost during a crash—so you better not forget to save.

                                       

                                      If you simple click Cancel the dialog won't appear on the next launch.

                                      • 16. Re: How Stop Indesign message using script ?
                                        John Mensinger Adobe Community Professional & MVP

                                        ...and anyone close InDesign with (Force Quit) from Dock Then after this if I want to create InDesign using script :

                                        This is like saying: "Every time my wife puts the car in the garage, she hits the wall. So how can I install a fully-equipped, automated repair service in the garage to fix the car every night so I can drive it undamaged in the morning?"

                                         

                                        Clearly, the solution to the problem is to prevent the damage.

                                        • 17. Re: How Stop Indesign message using script ?
                                          Bill joy Level 1

                                          Thanks to All for reply.

                                          • 18. Re: How Stop Indesign message using script ?
                                            Bill joy Level 1

                                            Hi Peter

                                            I try this

                                            After emptying the InDesign Recovery folder I start InDesign but it also prompt message

                                            If i press Yes then it say that this file does not exit.

                                             

                                            Thanks.

                                            • 19. Re: How Stop Indesign message using script ?
                                              Peter Spier Most Valuable Participant (Moderator)

                                              I suspect that means there's a flaw in your script someplace. If the recovery folder for the current user is empty ID would have no reason to initiate the recovery process on startup. Does it happen if you DON'T use the script to start ID?