¿Cómo puedo tener mi script .jsx cuando termine de ejecutar otro script .jsx?Adobe InDesign .jsx script ejecutar .jsx script
Tal vez esto ayudará a entender lo que estoy tratando de hacer:
// 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>
Espero que ayude?
Estoy teniendo problemas para leer eso, ¿dónde colocaría el script que me gustaría lanzar (PrintCard.jsx)? – jmituzas
var theScriptFile = new File ("/ absolute/path/to/PrintCard.jsx"); pero ... es posible que necesites la ruta absoluta ... las aplicaciones de adobe pueden comportarse de forma diferente con respecto a las rutas relativas; tendrá que experimentar con InDesign para ver si puede hacer un nuevo archivo ("../ PrintCard.jsx") o similar; si es posible, trate de evitar el camino absoluto, creo. –
Hahaha Debería haberlo leído nuevamente desde que me dijiste: new File ("/ path/to/file.jsx"); - perdón por eso ... – jmituzas