2012-08-06 3 views
0

InDesign 스크립팅을 사용하여 InDesign을 종료하고 Illustrator를 열려면 어떻게해야합니까?InDesign 스크립팅을 사용하여 InDesign을 종료하고 Illustrator를 여는 방법은 무엇입니까?

// 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); 

그러나 여기 스크립트가 인디자인을 종료하지 않고, 단지 일러스트 레이터를 열고이 내 코드입니다. 이 문제를 어떻게 해결할 수 있습니까?

답변

0

@Padmashree은 -

흠, 어쩌면 InDesign에서 어떤 방식으로 문   myDocument.close (SaveOptions.NO);  을 방해하는 것으로 보인다? 작동하는지

이 시도하고 참조 :

// 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; 

이것은 "NEVER_INTERACT는"모든 모달 대화 상자 창 (오류 메시지, 다른 응용 프로그램의 경고를 무시하는 응용 프로그램의 "사용자 상호 작용 수준을"변화).

나는 여기이 해결책을 발견 :


그러나 물론,   myDocument.close (SaveOptions.NO);   자체는 InDesign 문서를 닫고, 을하지 프로그램.

app.quit(SaveOptions.NO)   분명히 인디자인을 (: http://jongware.mit.edu/idcs5js/pc_Application.html 가에서 발견를 테스트하지) 종료됩니다.

+0

다음하려고 사용하는 경우 ... http://forums.adobe.com/message/4603168#4603168 답장을 보내 주셔서 감사합니다 :) 좋은 하루 되세요 :) – Padmashree

+0

@Padmashree - 아,'BridgeTalk' 알겠습니다. 또한 좋은 참고 자료를 위해 http://kasyan.ho.com.ua/convert_cmyk-rgb_images_to_grayscale.html을보십시오 (이것은 InDesign이 Photoshop과 통신하기위한 것입니다). –

0

것은 당신이 Win7에 내가 아래 링크에서 스크립트를 가지고 그것이 나를 위해 잘 작동

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