Copy link to clipboard
Copied
Hi,
I am trying to create a script for saving a copy of a eps file. Here is what I did:
/*
Read the files name from a list.txt file
Create the ./folder with the file name without extension if it does not exist.
If eps extension from the list copy the file in the created folder.
If jpg, resize the jpg accordingly to the user input and save the high quality jpg in the folder.
*/
#target bridge
if (BridgeTalk.appName == "bridge"){
var menu2 = MenuElement.create( "command", "Microstock", "at the end of Tools");
menu2.onSelect = function () {
filesFromList();
}
}
// AMEND PATH TO SUIT!
if(!fichiers.exists){
alert("List.txt does not exit " + fichiers);
return;
}
var agency = "";
var base = "C:/Users/Jean/Pictures/";
var myFolder = prompt("Nom du myFolder", "ACCEPTED-EPS");
var microstock = prompt("Longueur de l'image à créer?", 250);
switch(microstock){
case: 400
agency = "...";
default:
agency = "iStock";
}
var fichiers =File(base + myFolder + "/list.txt");
//////////////////////////////////////////////////////////////////////////////// ///////////
function filesFromList(){
fichiers.open("r");
while(!fichiers.eof){
var line = fichiers.readln();
for(var a in line){
targetFolder = new File(base + '/' + stripExtension(line) + '/' + line);
targetFolder.create ();
// copy the eps file there
// create a jpg from the eps there.
}
}
fichiers.close();
}
/////////////////////
function stripExtension(incoming){
incoming =incoming.substring(0, incoming.indexOf("."));
return incoming;
}
Thanks
JP
Copy link to clipboard
Copied
The following line should not be there.
If jpg, resize the jpg accordingly to the user input and save the high quality jpg in the folder.
it should be:
If eps extension from the list copy the file in the created folder.
Then create a jpg from it accordingly to the user input and save the high quality jpg in the folder.
If psd extension from the list copy the file in the created folder.
Then create a jpg from it accordingly to the user input and save the high quality jpg in the folder.
JP