Copy link to clipboard
Copied
I'm sure this is possible, but the way I have done it with actions seems somewhat converluted!
What I'm trying to do is: after I finished post on a client's images I want to burn a DVD with the high res JPG in the root (native image size at image res), and a sub folder called 'email' which has images of 1024 x 768 at 72 dpi.
It would be great to specify the default destination at run time, but not a biggie.
Can anyone get me started please?
thanks
tony
Copy link to clipboard
Copied
Are you wanting the script to burn the files to the DVD or just set up to make it easier to burn them?
I'm guessing the latter.
Also, did you want to put these into a special folder with a subfolder named "email" or use the current folder they are in and just create a subfolder in there named "email"?
How familiar are you with writing scripts?
Copy link to clipboard
Copied
Indeed the latter, I'll just use Nero to burn the files.
Just in a folder and then a sub folder called email is all that's required - if that's hardcoded that would not be a problem. Just so long as I know where it is
I'm familiar with writing VB scripts, batch files, etc - but this would be the first PS script!
thanks for the help
tony
Copy link to clipboard
Copied
Tony Harrison wrote:
Indeed the latter, I'll just use Nero to burn the files.
Just in a folder and then a sub folder called email is all that's required - if that's hardcoded that would not be a problem. Just so long as I know where it is
I'm familiar with writing VB scripts, batch files, etc - but this would be the first PS script!
thanks for the help
tony
Here ya go. I happened to have something similar that I use all the time but I use it to process my .CR2 files into websized jpgs. Just a little tweaking and it will do what you want, I hope....
You may want to change the jpgSaveOptions.quality = 8; line for the quality and the var ls = 800; to whatever you want for the long side dimension of your images.
You can also set a start folder in the var inputFolder=new Folder(); line like this var inputFolder=new Folder("c:\Folder\Subfolder"); It has to exist, though.
var startRulerUnits = app.preferences.rulerUnits;
var startTypeUnits = app.preferences.typeUnits ;
var startDisplayDialogs = app.displayDialogs;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
app.displayDialogs = DialogModes.NO;
var inputFolder=new Folder();
infold=inputFolder.selectDlg("Select Folder for conversion");
var inputFiles = infold.getFiles("*.jpg");
var outputFolder = new Folder(infold.fullName + "/email");
if (!outputFolder.exists) {outputFolder.create();}
var numf = inputFiles.length;
var op=new CameraRAWOpenOptions();
op.bitsPerChannel=BitsPerChannelType.EIGHT;
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = 8;
while (numf > 0) {
var infile=File(inputFiles[numf-1]);
open(infile,op);
var im=app.activeDocument;
var f=new String(im.name);
var len=f.length-4;
var jp=File(outputFolder+"/"+f.substring(0,len)+".jpg");
var ls = 800;
var h = im.height;
var w = im.width;
if (h > w) {
im.resizeImage(null,ls,null,ResampleMethod.BICUBIC);
}
else {
im.resizeImage(ls,null,null,ResampleMethod.BICUBIC);
}
im.saveAs(jp, jpgSaveOptions, true, Extension.LOWERCASE);
im.close(SaveOptions.DONOTSAVECHANGES);
numf--;
}
app.preferences.rulerUnits = startRulerUnits;
app.preferences.typeUnits = startTypeUnits;
app.displayDialogs = startDisplayDialogs;
Copy link to clipboard
Copied
Marvellous stuff - thank you.
99% of the way there - just need to figure out how to take them down from 240dpi to 72dpi - only intended for the web/email viewing so no need for the hi-res... are you able to get me across the line with that part. Must be a parameter in the resizeImage command, so I'll google the syntax for that command.
Greatly appreciate what you have done already and the speed with which you have done it.
thanks again
tony
Copy link to clipboard
Copied
Add this before the saveas line
im.resizeImage(undefined,undefined,72,ResampleMethod.NONE);
Copy link to clipboard
Copied
Thank you Michael - so straightforward. Appreciate your help.
If the folder has both JPG and CR2 files I'm assuming I could change the var inputFiles = infold.getFiles("*.jpg"); to "*.jpg;*.cr2" to capture both file formats in the one pass?
tony
Copy link to clipboard
Copied
Use .getFiles(/\.(jpg|cr2)$/i); to get jpg or cr2 and ignore case.
edit: That may not work with the script above. I thought that you wanted to resize for email/web. Why include raw files in the email folder?
Copy link to clipboard
Copied
If the folder has both JPG and CR2 files I'm assuming I could change the var inputFiles = infold.getFiles("*.jpg"); to "*.jpg;*.cr2" to capture both file formats in the one pass?
You may need to do it like this:
var inputFiles = infold.getFiles(/.*\.(jpg|cr2)/");
Copy link to clipboard
Copied
That's great - thanks for all your help - I now have exactly what I need, and appreciate everyone's help.
tony
Find more inspiration, events, and resources on the new Adobe Community
Explore Now