Hello, I am in need of a script to help export pages of different web sizes to jpeg with the File name + websize name.
I have each page within indesign built according to the size of the web. I couldnt for the life of me figure out how to somehow specify within a script to name page 1 = email_600x300 and page 2 = web 1200x700 and so on.
I don't have any knowlege with scripting, I did however created a script 2 years ago from just trial and error and messing with example scripts to export pdf or jpeg with multiple variations ( layers on or off)
// Proof pdf export version, smallest file size.
var myDocument = app.documents.item(0);
var myDoc = app.activeDocument;
var layers = myDocument.layers;
var slots, tables, hosted, nonHosted, hotel, promos, translation, i, myFileName;
// Export location
var myFolder = Folder.desktop;
// PDF Preset specification
// PDF PRESET SELECTIONS
var myPresets = app.pdfExportPresets.everyItem().name;
myPresets.unshift("- Select Preset -");
var myWin = new Window('dialog', 'PDF Export Presets');
myWin.orientation = 'row';
with(myWin){
myWin.sText = add('statictext', undefined, 'Select PDF Export preset:');
myWin.myPDFExport = add('dropdownlist',undefined,undefined,{items:myPresets});
myWin.myPDFExport.selection = 0;
myWin.btnOK = add('button', undefined, 'OK');
};
myWin.center();
var myWindow = myWin.show();
if(myWindow == true && myWin.myPDFExport.selection.index != 0){
var myPreset = app.pdfExportPresets.item(String(myWin.myPDFExport.selection));
}else{
alert("No PDF Preset selected");
}
for(var myCounter = 0; myCounter < 8; myCounter ++){
switch(myCounter){
case 0:
// Slots Version
// Hosted
fileName = "16853_DBM_Mailer_07_19_Back_Slots_Hosted";
slots = "Slots";
hosted = "Hosted Vault W-F";
hotel = "BS Hosted";
promos = "off";
translation = "off";
break;
case 1:
// Non_Hosted
fileName = "16853_DBM_Mailer_07_19_Back_Slots_Non_Hosted";
slots = "Slots";
hosted = "Hosted Vault W-F";
nonHosted;
hotel = "BS Non Hosted";
promos = "off";
translation = "off";
break;
case 2:
// Slots Translated Version
fileName = "16853_DBM_Mailer_07_19_Back_Slots_Translated";
slots = "Slots";
hosted = "Hosted Vault W-F";
hotel = "BS Hosted";
promos= "off"
translation = "F&B Translated";
break;
case 3:
// Tables Version
// Hosted
fileName = "16853_DBM_Mailer_07_19_Back_Tables_Hosted";
slots = "off";
tables = "Tables";
hosted = "Hosted Vault W-F";
hotel = "BS Hosted";
promos = "off";
translation = "off";
break;
case 4:
// Non_Hosted
fileName = "16853_DBM_Mailer_07_19_Back_Tables_Non_Hosted";
slots = "off";
tables = "Tables";
nonHosted;
hosted = "Hosted Vault W-F";
hotel = "BS Non Hosted";
promos = "off";
translation = "off"
break;
case 5:
// Tables Translated Version
fileName = "16853_DBM_Mailer_07_19_Back_Tables_Translated";
slots = "off";
tables = "Tables";
hosted = "Hosted Vault W-F";
hotel = "BS Hosted";
promos = "off"
translation = "F&B Translated";
break;
}
for(i = 0; i < myDocument.layers.length; i ++){
if((layers.item(i).name == slots )|| (layers.item(i).name == tables )|| (layers.item(i).name == hosted )|| (layers.item(i).name == nonHosted )||
(layers.item(i).name == hotel )|| (layers.item(i).name == promos )|| (layers.item(i).name == "L8P Drawing Tues")|| (layers.item(i).name == "ENT Nightlife")||
(layers.item(i).name == "Car Promo")|| (layers.item(i).name == "F&B")|| (layers.item(i).name == "Retail")|| (layers.item(i).name == "Battle Cards")||
(layers.item(i).name == "Club Serrano Benefits")|| (layers.item(i).name == "Overlays")|| (layers.item(i).name == translation )|| (layers.item(i).name == "Cash Sundays")){
layers.item(i).visible = true;
layers.item(i).printable = true;
}
else{
layers.item(i).visible = false;
}
}
myFileName = myFolder + "/" + fileName + ".pdf";
myDocument.exportFile(ExportFormat.pdfType, File(myFileName), false, myPreset);
}
That worked great for that specific project that happens on a month bases which required upto 72 variations when exporting for proof. But this was long time ago I totally forgot how it all works and plus that is for layers and each indesign file has 1 page only.
If anyone can help with a simple script I can go in and customize that would be much appreciated.
The websizes won't change, so the scripts I found online where it gives you a prompt to manually enter the name isnt going to work. I prefer to set the naming within the script as it does not need to change.
Thanks!