How do I quit InDesign and open Illustrator using InDesign scripting?












0















How do I quit InDesign and open Illustrator using InDesign scripting? This is my code:



// closing the InDesign document here
myDocument.close(SaveOptions.NO);

// change the script's target to Illustrator
#target illustrator

app.documents.add(DocumentColorSpace.CMYK, width = 1024, height = 768);


But here the script is not quitting InDesign, and only opening Illustrator. How can I resolve this?










share|improve this question





























    0















    How do I quit InDesign and open Illustrator using InDesign scripting? This is my code:



    // closing the InDesign document here
    myDocument.close(SaveOptions.NO);

    // change the script's target to Illustrator
    #target illustrator

    app.documents.add(DocumentColorSpace.CMYK, width = 1024, height = 768);


    But here the script is not quitting InDesign, and only opening Illustrator. How can I resolve this?










    share|improve this question



























      0












      0








      0








      How do I quit InDesign and open Illustrator using InDesign scripting? This is my code:



      // closing the InDesign document here
      myDocument.close(SaveOptions.NO);

      // change the script's target to Illustrator
      #target illustrator

      app.documents.add(DocumentColorSpace.CMYK, width = 1024, height = 768);


      But here the script is not quitting InDesign, and only opening Illustrator. How can I resolve this?










      share|improve this question
















      How do I quit InDesign and open Illustrator using InDesign scripting? This is my code:



      // closing the InDesign document here
      myDocument.close(SaveOptions.NO);

      // change the script's target to Illustrator
      #target illustrator

      app.documents.add(DocumentColorSpace.CMYK, width = 1024, height = 768);


      But here the script is not quitting InDesign, and only opening Illustrator. How can I resolve this?







      indesign extendscript






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 8 '12 at 5:24









      Michael Petrotta

      51.6k12127171




      51.6k12127171










      asked Aug 6 '12 at 6:45









      PadmashreePadmashree

      24




      24
























          4 Answers
          4






          active

          oldest

          votes


















          1














          You have to use BridgeTalk to communicate between Illustrator and InDesign.



          Examples:




          • http://forums.adobe.com/thread/287542

          • http://ajarproductions.com/blog/2008/12/14/easy-and-readable-extendscript-to-jsfl-workflow/

          • http://selfdocumentingcode.blogspot.com/2009/05/using-adobe-bridgetalk-synchronously.html


          You should probably wait for a response from Illustrator before closing InDesign, so that you know the script is done executing.






          share|improve this answer































            0














            @Padmashree --



            Hmm, maybe it is possible that InDesign is interrupting your statement  myDocument.close ( SaveOptions.NO );  in some way?



            Try this and see if it works:



             // the original interaction and warning settings of the application
            var oldInteractionPrefs = app.scriptPreferences.userInteractionLevel;

            // prevent interaction and warnings from interrupting script
            app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

            // close the active document without saving
            app.activeDocument.close(SaveOptions.no);

            // reset interactions to original settings
            app.scriptPreferences.userInteractionLevel = oldInteractionPrefs;


            This is changing the "user interaction level" of the application to "NEVER_INTERACT" to ignore all modal dialog windows (error messages, other application alerts).


            I found this solution here at:




            • InDesign CS5 Script: How can I ignore the DTD when importing XML?

            • and InDesign CS5 Script: How can I close all modal dialog windows in a document?





            But of course,  myDocument.close ( SaveOptions.NO );  itself only closes an InDesign document, and not the program.


            app.quit(SaveOptions.NO)  apparently closes InDesign (not tested, found at: http://jongware.mit.edu/idcs5js/pc_Application.html).






            share|improve this answer


























            • I got the script from below link and it works fine for me... forums.adobe.com/message/4603168#4603168 Thank you for reply :) Have a nice day :)

              – Padmashree
              Aug 9 '12 at 3:57













            • @Padmashree -- Ah, BridgeTalk, I see. Also look at kasyan.ho.com.ua/convert_cmyk-rgb_images_to_grayscale.html for a good reference (this is for InDesign communicating with Photoshop, though).

              – Ian Campbell
              Aug 9 '12 at 4:38





















            0














            If you are using Win7 try next



            var mySelect = app.selection[0].graphics[0].itemLink
            var myFilePath = mySelect.filePath;
            var myProg = "Illustrator";
            var myFile = myFilePath;
            var myScript = "";
            myScript += "Dim WshShellr";
            myScript += "Set WshShell = CreateObject("WScript.Shell")r";
            myScript += "ReturnCode = WshShell.Run (""""+myProg+".exe"""""+myFile+"""",1)r";
            app.doScript(myScript, ScriptLanguage.VISUAL_BASIC);





            share|improve this answer































              0














              I came across this thread just barely and was actually looking for a way to close Photoshop via extendscript. If that is what you were looking for use this:



                  var idquit = charIDToTypeID( "quit" );

              executeAction( idquit, undefined, DialogModes.ALL );





              share|improve this answer























                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f11823615%2fhow-do-i-quit-indesign-and-open-illustrator-using-indesign-scripting%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                1














                You have to use BridgeTalk to communicate between Illustrator and InDesign.



                Examples:




                • http://forums.adobe.com/thread/287542

                • http://ajarproductions.com/blog/2008/12/14/easy-and-readable-extendscript-to-jsfl-workflow/

                • http://selfdocumentingcode.blogspot.com/2009/05/using-adobe-bridgetalk-synchronously.html


                You should probably wait for a response from Illustrator before closing InDesign, so that you know the script is done executing.






                share|improve this answer




























                  1














                  You have to use BridgeTalk to communicate between Illustrator and InDesign.



                  Examples:




                  • http://forums.adobe.com/thread/287542

                  • http://ajarproductions.com/blog/2008/12/14/easy-and-readable-extendscript-to-jsfl-workflow/

                  • http://selfdocumentingcode.blogspot.com/2009/05/using-adobe-bridgetalk-synchronously.html


                  You should probably wait for a response from Illustrator before closing InDesign, so that you know the script is done executing.






                  share|improve this answer


























                    1












                    1








                    1







                    You have to use BridgeTalk to communicate between Illustrator and InDesign.



                    Examples:




                    • http://forums.adobe.com/thread/287542

                    • http://ajarproductions.com/blog/2008/12/14/easy-and-readable-extendscript-to-jsfl-workflow/

                    • http://selfdocumentingcode.blogspot.com/2009/05/using-adobe-bridgetalk-synchronously.html


                    You should probably wait for a response from Illustrator before closing InDesign, so that you know the script is done executing.






                    share|improve this answer













                    You have to use BridgeTalk to communicate between Illustrator and InDesign.



                    Examples:




                    • http://forums.adobe.com/thread/287542

                    • http://ajarproductions.com/blog/2008/12/14/easy-and-readable-extendscript-to-jsfl-workflow/

                    • http://selfdocumentingcode.blogspot.com/2009/05/using-adobe-bridgetalk-synchronously.html


                    You should probably wait for a response from Illustrator before closing InDesign, so that you know the script is done executing.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Sep 16 '12 at 4:59









                    Justin PutneyJustin Putney

                    669315




                    669315

























                        0














                        @Padmashree --



                        Hmm, maybe it is possible that InDesign is interrupting your statement  myDocument.close ( SaveOptions.NO );  in some way?



                        Try this and see if it works:



                         // the original interaction and warning settings of the application
                        var oldInteractionPrefs = app.scriptPreferences.userInteractionLevel;

                        // prevent interaction and warnings from interrupting script
                        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

                        // close the active document without saving
                        app.activeDocument.close(SaveOptions.no);

                        // reset interactions to original settings
                        app.scriptPreferences.userInteractionLevel = oldInteractionPrefs;


                        This is changing the "user interaction level" of the application to "NEVER_INTERACT" to ignore all modal dialog windows (error messages, other application alerts).


                        I found this solution here at:




                        • InDesign CS5 Script: How can I ignore the DTD when importing XML?

                        • and InDesign CS5 Script: How can I close all modal dialog windows in a document?





                        But of course,  myDocument.close ( SaveOptions.NO );  itself only closes an InDesign document, and not the program.


                        app.quit(SaveOptions.NO)  apparently closes InDesign (not tested, found at: http://jongware.mit.edu/idcs5js/pc_Application.html).






                        share|improve this answer


























                        • I got the script from below link and it works fine for me... forums.adobe.com/message/4603168#4603168 Thank you for reply :) Have a nice day :)

                          – Padmashree
                          Aug 9 '12 at 3:57













                        • @Padmashree -- Ah, BridgeTalk, I see. Also look at kasyan.ho.com.ua/convert_cmyk-rgb_images_to_grayscale.html for a good reference (this is for InDesign communicating with Photoshop, though).

                          – Ian Campbell
                          Aug 9 '12 at 4:38


















                        0














                        @Padmashree --



                        Hmm, maybe it is possible that InDesign is interrupting your statement  myDocument.close ( SaveOptions.NO );  in some way?



                        Try this and see if it works:



                         // the original interaction and warning settings of the application
                        var oldInteractionPrefs = app.scriptPreferences.userInteractionLevel;

                        // prevent interaction and warnings from interrupting script
                        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

                        // close the active document without saving
                        app.activeDocument.close(SaveOptions.no);

                        // reset interactions to original settings
                        app.scriptPreferences.userInteractionLevel = oldInteractionPrefs;


                        This is changing the "user interaction level" of the application to "NEVER_INTERACT" to ignore all modal dialog windows (error messages, other application alerts).


                        I found this solution here at:




                        • InDesign CS5 Script: How can I ignore the DTD when importing XML?

                        • and InDesign CS5 Script: How can I close all modal dialog windows in a document?





                        But of course,  myDocument.close ( SaveOptions.NO );  itself only closes an InDesign document, and not the program.


                        app.quit(SaveOptions.NO)  apparently closes InDesign (not tested, found at: http://jongware.mit.edu/idcs5js/pc_Application.html).






                        share|improve this answer


























                        • I got the script from below link and it works fine for me... forums.adobe.com/message/4603168#4603168 Thank you for reply :) Have a nice day :)

                          – Padmashree
                          Aug 9 '12 at 3:57













                        • @Padmashree -- Ah, BridgeTalk, I see. Also look at kasyan.ho.com.ua/convert_cmyk-rgb_images_to_grayscale.html for a good reference (this is for InDesign communicating with Photoshop, though).

                          – Ian Campbell
                          Aug 9 '12 at 4:38
















                        0












                        0








                        0







                        @Padmashree --



                        Hmm, maybe it is possible that InDesign is interrupting your statement  myDocument.close ( SaveOptions.NO );  in some way?



                        Try this and see if it works:



                         // the original interaction and warning settings of the application
                        var oldInteractionPrefs = app.scriptPreferences.userInteractionLevel;

                        // prevent interaction and warnings from interrupting script
                        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

                        // close the active document without saving
                        app.activeDocument.close(SaveOptions.no);

                        // reset interactions to original settings
                        app.scriptPreferences.userInteractionLevel = oldInteractionPrefs;


                        This is changing the "user interaction level" of the application to "NEVER_INTERACT" to ignore all modal dialog windows (error messages, other application alerts).


                        I found this solution here at:




                        • InDesign CS5 Script: How can I ignore the DTD when importing XML?

                        • and InDesign CS5 Script: How can I close all modal dialog windows in a document?





                        But of course,  myDocument.close ( SaveOptions.NO );  itself only closes an InDesign document, and not the program.


                        app.quit(SaveOptions.NO)  apparently closes InDesign (not tested, found at: http://jongware.mit.edu/idcs5js/pc_Application.html).






                        share|improve this answer















                        @Padmashree --



                        Hmm, maybe it is possible that InDesign is interrupting your statement  myDocument.close ( SaveOptions.NO );  in some way?



                        Try this and see if it works:



                         // the original interaction and warning settings of the application
                        var oldInteractionPrefs = app.scriptPreferences.userInteractionLevel;

                        // prevent interaction and warnings from interrupting script
                        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

                        // close the active document without saving
                        app.activeDocument.close(SaveOptions.no);

                        // reset interactions to original settings
                        app.scriptPreferences.userInteractionLevel = oldInteractionPrefs;


                        This is changing the "user interaction level" of the application to "NEVER_INTERACT" to ignore all modal dialog windows (error messages, other application alerts).


                        I found this solution here at:




                        • InDesign CS5 Script: How can I ignore the DTD when importing XML?

                        • and InDesign CS5 Script: How can I close all modal dialog windows in a document?





                        But of course,  myDocument.close ( SaveOptions.NO );  itself only closes an InDesign document, and not the program.


                        app.quit(SaveOptions.NO)  apparently closes InDesign (not tested, found at: http://jongware.mit.edu/idcs5js/pc_Application.html).







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited May 23 '17 at 12:04









                        Community

                        11




                        11










                        answered Aug 8 '12 at 5:09









                        Ian CampbellIan Campbell

                        1,42284291




                        1,42284291













                        • I got the script from below link and it works fine for me... forums.adobe.com/message/4603168#4603168 Thank you for reply :) Have a nice day :)

                          – Padmashree
                          Aug 9 '12 at 3:57













                        • @Padmashree -- Ah, BridgeTalk, I see. Also look at kasyan.ho.com.ua/convert_cmyk-rgb_images_to_grayscale.html for a good reference (this is for InDesign communicating with Photoshop, though).

                          – Ian Campbell
                          Aug 9 '12 at 4:38





















                        • I got the script from below link and it works fine for me... forums.adobe.com/message/4603168#4603168 Thank you for reply :) Have a nice day :)

                          – Padmashree
                          Aug 9 '12 at 3:57













                        • @Padmashree -- Ah, BridgeTalk, I see. Also look at kasyan.ho.com.ua/convert_cmyk-rgb_images_to_grayscale.html for a good reference (this is for InDesign communicating with Photoshop, though).

                          – Ian Campbell
                          Aug 9 '12 at 4:38



















                        I got the script from below link and it works fine for me... forums.adobe.com/message/4603168#4603168 Thank you for reply :) Have a nice day :)

                        – Padmashree
                        Aug 9 '12 at 3:57







                        I got the script from below link and it works fine for me... forums.adobe.com/message/4603168#4603168 Thank you for reply :) Have a nice day :)

                        – Padmashree
                        Aug 9 '12 at 3:57















                        @Padmashree -- Ah, BridgeTalk, I see. Also look at kasyan.ho.com.ua/convert_cmyk-rgb_images_to_grayscale.html for a good reference (this is for InDesign communicating with Photoshop, though).

                        – Ian Campbell
                        Aug 9 '12 at 4:38







                        @Padmashree -- Ah, BridgeTalk, I see. Also look at kasyan.ho.com.ua/convert_cmyk-rgb_images_to_grayscale.html for a good reference (this is for InDesign communicating with Photoshop, though).

                        – Ian Campbell
                        Aug 9 '12 at 4:38













                        0














                        If you are using Win7 try next



                        var mySelect = app.selection[0].graphics[0].itemLink
                        var myFilePath = mySelect.filePath;
                        var myProg = "Illustrator";
                        var myFile = myFilePath;
                        var myScript = "";
                        myScript += "Dim WshShellr";
                        myScript += "Set WshShell = CreateObject("WScript.Shell")r";
                        myScript += "ReturnCode = WshShell.Run (""""+myProg+".exe"""""+myFile+"""",1)r";
                        app.doScript(myScript, ScriptLanguage.VISUAL_BASIC);





                        share|improve this answer




























                          0














                          If you are using Win7 try next



                          var mySelect = app.selection[0].graphics[0].itemLink
                          var myFilePath = mySelect.filePath;
                          var myProg = "Illustrator";
                          var myFile = myFilePath;
                          var myScript = "";
                          myScript += "Dim WshShellr";
                          myScript += "Set WshShell = CreateObject("WScript.Shell")r";
                          myScript += "ReturnCode = WshShell.Run (""""+myProg+".exe"""""+myFile+"""",1)r";
                          app.doScript(myScript, ScriptLanguage.VISUAL_BASIC);





                          share|improve this answer


























                            0












                            0








                            0







                            If you are using Win7 try next



                            var mySelect = app.selection[0].graphics[0].itemLink
                            var myFilePath = mySelect.filePath;
                            var myProg = "Illustrator";
                            var myFile = myFilePath;
                            var myScript = "";
                            myScript += "Dim WshShellr";
                            myScript += "Set WshShell = CreateObject("WScript.Shell")r";
                            myScript += "ReturnCode = WshShell.Run (""""+myProg+".exe"""""+myFile+"""",1)r";
                            app.doScript(myScript, ScriptLanguage.VISUAL_BASIC);





                            share|improve this answer













                            If you are using Win7 try next



                            var mySelect = app.selection[0].graphics[0].itemLink
                            var myFilePath = mySelect.filePath;
                            var myProg = "Illustrator";
                            var myFile = myFilePath;
                            var myScript = "";
                            myScript += "Dim WshShellr";
                            myScript += "Set WshShell = CreateObject("WScript.Shell")r";
                            myScript += "ReturnCode = WshShell.Run (""""+myProg+".exe"""""+myFile+"""",1)r";
                            app.doScript(myScript, ScriptLanguage.VISUAL_BASIC);






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jul 9 '13 at 23:30









                            AnatolyAnatoly

                            262




                            262























                                0














                                I came across this thread just barely and was actually looking for a way to close Photoshop via extendscript. If that is what you were looking for use this:



                                    var idquit = charIDToTypeID( "quit" );

                                executeAction( idquit, undefined, DialogModes.ALL );





                                share|improve this answer




























                                  0














                                  I came across this thread just barely and was actually looking for a way to close Photoshop via extendscript. If that is what you were looking for use this:



                                      var idquit = charIDToTypeID( "quit" );

                                  executeAction( idquit, undefined, DialogModes.ALL );





                                  share|improve this answer


























                                    0












                                    0








                                    0







                                    I came across this thread just barely and was actually looking for a way to close Photoshop via extendscript. If that is what you were looking for use this:



                                        var idquit = charIDToTypeID( "quit" );

                                    executeAction( idquit, undefined, DialogModes.ALL );





                                    share|improve this answer













                                    I came across this thread just barely and was actually looking for a way to close Photoshop via extendscript. If that is what you were looking for use this:



                                        var idquit = charIDToTypeID( "quit" );

                                    executeAction( idquit, undefined, DialogModes.ALL );






                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Nov 16 '18 at 22:38









                                    Helder PerezHelder Perez

                                    1




                                    1






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f11823615%2fhow-do-i-quit-indesign-and-open-illustrator-using-indesign-scripting%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        How to pass form data using jquery Ajax to insert data in database?

                                        National Museum of Racing and Hall of Fame

                                        Guess what letter conforming each word