Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

savingh a copy of a eps

Community Beginner ,
Aug 27, 2010 Aug 27, 2010

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

TOPICS
Scripting
455
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 27, 2010 Aug 27, 2010
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines