完成执行另一个 .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>
最佳答案
您可以轻松包含另一个脚本,该脚本将在您包含它的地方执行:
// ... Do something (will be executed before teardown script)
#include "../path/to/teardown/script.jsx"
// the path can be absolute or relative.
这应该适用于从 CS3 向上的 InDesign。
关于Adobe InDesign .jsx 脚本执行 .jsx 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4695444/