Hi everyone,
I’m having trouble with a script that I’ve adapted to suit my need.
Now I’m would like to apply that script to a specific layer, but don’t know where to start.
Here’s the script:
//Exportations des images en JPG
var myDoc = app.activeDocument,
apis = myDoc.links.everyItem().getElements(),
items, fileName;
var i = 0;
var MyPath = Folder.selectDialog(“Enregistrer les images en JPEG – 100 dpi – Qualité Compression : High”);
alert(“Le script travaille, merci d’attendre un peu…”);
//alert(MyPath);
while (items = apis.pop()) {
items = items.parent.parent;
if (!(items.hasOwnProperty(“graphics”))) {
continue;
}
i++;
try {
fileName = File(items.graphics[0].itemLink.filePath).name;
fileName = fileName.replace(/\.[a-z]{2,4}$/i, ‘.jpg’);
} catch (e) {};
app.jpegExportPreferences.exportResolution = 200;
app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.HIGH;
//give it a unique name
var myFile = new File(MyPath + “/” + fileName);
items.graphics[0].exportFile(ExportFormat.JPG, myFile);
}
alert(“Le script a terminé son travail. Vous pouvez exporter vos images dans Virtual Paper. Merci!VirtualPaper JPEG Exporter 2.1 (03/2021) pour InDesign CC© &CO • 2021”);
If someone could help me out.
Thanks Patrick