How do I quit InDesign and open Illustrator using InDesign scripting?
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
add a comment |
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
add a comment |
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
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
indesign extendscript
edited Aug 8 '12 at 5:24
Michael Petrotta
51.6k12127171
51.6k12127171
asked Aug 6 '12 at 6:45
PadmashreePadmashree
24
24
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
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.
add a comment |
@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).
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
add a comment |
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);
add a comment |
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 );
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Sep 16 '12 at 4:59
Justin PutneyJustin Putney
669315
669315
add a comment |
add a comment |
@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).
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
add a comment |
@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).
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
add a comment |
@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).@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).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
add a comment |
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
add a comment |
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);
add a comment |
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);
add a comment |
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);
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);
answered Jul 9 '13 at 23:30
AnatolyAnatoly
262
262
add a comment |
add a comment |
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 );
add a comment |
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 );
add a comment |
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 );
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 );
answered Nov 16 '18 at 22:38
Helder PerezHelder Perez
1
1
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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