Please help - rewrite script to affect all the files in the folder, not one (Photoshop, JavaScript)

Hey guys ,.

I don't know much about scripts, but I managed to put together a script that takes the *.ps (postscript) file, open it in photoshop with some settings and then save it in two sizes in two different folders in jpeg. But unfortunately, it only affects a single file *.ps (in a specified path). I have hundreds of these *.ps files and just thinking about opening one makes me dizzy is it possible that I could choose folder with all these *.ps files and script would make these changes to all of them?

I'd appreciate any help .

Here is my script:

Open the file with parameters 1050x750px + rgb eps

var epsOpts = new EPSOpenOptions();

epsOpts.antiAlias = true;

epsOpts.mode = OpenDocumentMode.RGB;

epsOpts.resolution = 72;

epsOpts.constrainProportions = true;

epsOpts.width = new UnitValue (1050, "px")

var f = new File ("C: / monchemin/myfile.ps '");

App.Open (f, epsOpts);

Save 1050px

var doc = app.activeDocument;

var Path = ' C: / monchemin/resize/1050 /';

var Name = doc.name.replace (/ \.) [ ^\.] +$/, '');

var saveFile = file (path + "/" + Name + ".jpg");

SaveJPEG (saveFile, 12);

function SaveJPEG (saveFile, jpegQuality) {}

jpgSaveOptions = new JPEGSaveOptions();

jpgSaveOptions.embedColorProfile = true;

jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;

jpgSaveOptions.matte = MatteType.NONE;

jpgSaveOptions.quality = jpegQuality;

activeDocument.saveAs (saveFile, jpgSaveOptions, true, Extension.LOWERCASE);

}

resize to 360px

app.activeDocument.resizeImage ("360 pixels", "257 pixels", 72, ResampleMethod.BICUBIC);

Save 360px

var doc360 = app.activeDocument;

var Path360 = ' C: / monchemin/resize/360 /';

var Name360 = doc.name.replace (/ \.) [ ^\.] +$/, '');

var File = saveFile360 (Path360 + "/" + Name360 + '.jpg');

SaveJPEG360 (saveFile360, 12);

function SaveJPEG360 (saveFile360, jpegQuality) {}

jpgSaveOptions = new JPEGSaveOptions();

jpgSaveOptions.embedColorProfile = true;

jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;

jpgSaveOptions.matte = MatteType.NONE;

jpgSaveOptions.quality = jpegQuality;

activeDocument.saveAs (saveFile360, jpgSaveOptions, true, Extension.LOWERCASE);

}

Close the file

app.activeDocument.close (SaveOptions.DONOTSAVECHANGES);

Thanks in advance !

This would be an alert for each file in the formats defined in the selected folder.

Of course, you can insert the code you need in the clause for.

Var folder = Folder.selectDialog ("select folder");

If {(Folder)

Uses of the var = theFolder.getFiles (/ \.) (jpg) | TIF | EPS | PSD | (ch) / $i);

for (var m = 0; m< thefiles.length;="" m++)="">

Alert (theFiles [m])

};

};

Tags: Photoshop

Similar Questions

Maybe you are looking for

  • Case of Structure / while loop problems

    Hello I am trying to write a code that draws a random number whenever a key is pressed.  The chart must be a random number on the y axis and the number of times that the button is pressed on the x-axis.  I want to draw the last twenty random numbers.

  • SELPHY CP900 and iOS7

    The Selphy CP900 is compatible with iOS7? Mine is no longer connect to the internet after installing iOS7 on my iPad.

  • I need help pleas

    my hp does not go fast and I don't know what to do

  • Is it possible to have a 22 character product key?

    Install Vista Ultimate.  Is it possible to have a 22 character product key or does that mean that it is a counterfeit copy?  At all holograms, security threads, etc. Original title: install Vista Ultimate.  Is it possible to have a 22 character produ

  • Should UHVVHQWLHV I do to activate windows vista, which has already been used on another pc

    I recently removed my hard drive of a computer toshiba laptop that is is no longer in use, but the custom of software windows vista activate as it says it is already in use. But it is not in use on any other pc now. Installation disks are toshiba ori