saving images in a specific folder
Hi à la ligne
I use a script to convert all images to jpg format. This part of the script is OK.
var myDoc = app.activeDocument,
apis = myDoc.allPageItems, rect, fileName;
while ( rect = apis.pop() )
{
alert(rect.graphics[0].itemLink.filePath)
if ( !(rect instanceof Rectangle) || !rect.graphics[0].isValid ){ continue; }
fileName = File ( rect.graphics[0].itemLink.filePath ).name;
fileName = fileName.replace( /\.[a-z]{2,4}$/i, '.jpg' );
app.jpegExportPreferences.exportResolution = 300;
app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.MEDIUM;
//make new folder
var f = new Folder("C:/Users/laure/Creative Cloud Files/SousLeSoleil_Livre/Links/Images/");
f.create();
//give it a unique name
var myFile = new File('C:/Users/laure/Creative Cloud Files/SousLeSoleil_Livre/Links/Images/' + fileName);
rect.exportFile(ExportFormat.JPG, myFile);
I have to specify the file path manualy (bold).
I would like to save the jpg images in the a new folder (ex.: /images/) in the /Links/ folder anywhere the Package is save.
Is it possible to change this script to do this ?
Thanks for help.
Best
LT
