다른 .jsx 스크립트를 완료하면 내 .jsx 스크립트를 어떻게 가질 수 있습니까?Adobe InDesign .jsx 스크립트는 .jsx 스크립트를 실행합니다.
어쩌면 이것이 내가 뭘하려고 오전 이해하는 데 도움이됩니다 도움이
// WebCard.jsx file
function mySnippet(){
//<fragment>
var myPageName, myFilePath, myFile;
var myDocument = app.documents.item(0);
var myBaseName = myDocument.name;
for(var myCounter = 0; myCounter < myDocument.pages.length; myCounter++){
myPageName = myDocument.pages.item(myCounter).name;
app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;
app.jpegExportPreferences.resolution = 96;
app.jpegExportPreferences.pageString = myPageName;
switch(myPageName) {
case "1" : myPageName = "EN FRONT WebCard";
docType = "Web/Web Cards" break;
case "2" : myPageName = "EN BACK WebCard";
docType = "Web/Web Cards" break;
case "3" : myPageName = "ES FRONT WebCard";
docType = "Web/Web Cards" break;
case "4" : myPageName = "ES BACK WebCard";
docType = "Web/Web Cards" break;
}
fileName = group + " " + myPageName + " " + date + ".jpg";
myFilePath = dirPath + docType + "/" + fileName;
myDocument.exportFile(ExportFormat.jpg, File(myFilePath), false);
}
//</fragment>
}
//</snippet>
// execute PrintCard.jsx file
//<teardown>
function myTeardown(){
}
//</teardown>
희망?
나는 그것을 읽는데 약간의 문제가있다. 내가 시작하고 싶은 스크립트 (PrintCard.jsx)를 어디에 두 겠는가? – jmituzas
var theScriptFile = 새 파일 ("/ 절대/경로/to/PrintCard.jsx"); 하지만 ... 절대 경로가 필요할 수 있습니다 ... 어도비 애플 리케이션은 상대 경로에 대해 다르게 동작 할 수 있습니다. InDesign을 사용하여 새 파일 ("../ PrintCard.jsx") 또는 유사한 파일을 만들 수 있는지 확인해야합니다. 가능하다면 나는 절대적인 길을 피하려고 노력한다. –
하하하 당신이 진술 한 이후로 다시 읽어야합니다 : new File ("/ path/to/file.jsx"); - 죄송합니다 ... – jmituzas