Come posso avere il mio script .jsx al termine dell'esecuzione di un altro .jsx script?Script .jsx di Adobe InDesign script execute .jsx
Forse questo aiuterà a capire quello che sto cercando di fare:
// 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>
Speranza che aiuta?
Sto avendo un po 'di problemi a leggere, dove dovrei posizionare lo script che vorrei avviare (PrintCard.jsx)? – jmituzas
var theScriptFile = new File ("/ absolute/path/to/PrintCard.jsx"); ma ... potresti aver bisogno del percorso assoluto ... le app di adobe potrebbero comportarsi diversamente sui percorsi relativi; dovrai sperimentare con InDesign per vedere se puoi fare un nuovo file ("../ PrintCard.jsx") o simili; se possibile, cerca di evitare il percorso assoluto che penso. –
Hahaha avrei dovuto leggerlo di nuovo dato che hai dichiarato: nuovo file ("/ percorso/to/file.jsx"); - Mi dispiace per quello ... – jmituzas