Copy link to clipboard
Copied
So I have a few hundred image files that consist of 3 or 4 scanned photos also called "gang" scanned. The photoshop "Crop & Straighten" ability (located under File-->Automate) is great...But I want to be abe to run a script that will prompt me for a folder to be processed and then run the Crop & Straighten on all the photos, while saving them to another folder called "Edited" or something. I found a script in the forums for this exact purpose, but it doesn't seem to work in CS5. I ran it multiple times, it creates the folder "Edited" but nothing is inside of it. The script I found is posted below. Any ideas? I would really appreciate the help!
#target Photoshop
app.bringToFront;
var inFolder = Folder.selectDialog("Please select folder to process");
if(inFolder != null){
var fileList = inFolder.getFiles(/\.(jpg|tif|psd|)$/i);
var outfolder = new Folder(decodeURI(inFolder) + "/Edited");
if (outfolder.exists == false) outfolder.create();
for(var a = 0 ;a < fileList.length; a++){
if(fileList instanceof File){
var doc= open(fileList);
doc.flatten();
var docname = fileList.name.slice(0,-4);
CropStraighten();
doc.close(SaveOptions.DONOTSAVECHANGES);
var count = 1;
while(app....
The script is only looking for jpg, tif or psd files, if your files are in a differenent format that format would need adding to the script.
It also could be a problem with the editor you used to save the script, some programs will add control characters and stop the script working.
It is best to use ExtendScript Toolkit as this is the program installed with Photoshop for editing/testing scripts.
Copy link to clipboard
Copied
Could you please post an exemplary scan (in lores)?
Copy link to clipboard
Copied
The script is only looking for jpg, tif or psd files, if your files are in a differenent format that format would need adding to the script.
It also could be a problem with the editor you used to save the script, some programs will add control characters and stop the script working.
It is best to use ExtendScript Toolkit as this is the program installed with Photoshop for editing/testing scripts.
Copy link to clipboard
Copied
I feel like a complete idiot...Turns out that my scanned images were saved as .jpeg instead on .jpg...so I changed the extensions and it worked like a charm! Thanks guys!
Copy link to clipboard
Copied
Hi there,
I have tested one script and encountered one problem; the script/PS is very aggressive. The result has been that single images have been divided to multiple images and many time "over cropped" and rotated in various degrees. Crazy : )
Example Before/after:
Script used:
Dropbox - CROPAndStraightenBatch.jsx
I have about 3000 images that I would like to have cropped.
What I would like to have is a script where I can state or set it to not allow it to divide pictures into many.
Also...any script that can automate rotations as batch?
Does this exist somewhere?
Are there any scripts somewhere that I can test?
Cheers
Martin
Copy link to clipboard
Copied
I've tried every snippet of code I can find, for the life of me, I can't get a batch to work, they all hangup on the call to the action
Copy link to clipboard
Copied
you can do this with an action and a batch process. start recording and action, open a file to be processed, run the auto crop & streighten, them file -> close all, and choose the folder you wish to save to. Then batch process that action with the folder of unprocessed images as the source and save and close as the destination. Doing this from memory so I may have a detail or two wrong.
scaned over a thousand photos this way and included a auto color correction into the action. Worked very well.
Copy link to clipboard
Copied
Greetings! I saw Rob's reply above about automating this process using an action and batch process (as opposed to the script being used in the OP). I used to have this set up and lost it when I upgraded to CC years ago.
​
​As Rob accomplished this as well as myself in the past, I know it can be done. However, Adobe support is lacking on this simple Action topic and most in the forums are using scripts like the OP for this should be simple task.
​
​I had gotten about as far as Rob's instructions, before finding this thread but have some hang ups. I am hoping he or someone else may run by me the actual steps needed for this Action.
​
​My requirements would be to crop and straighten all images in source folder. Then have the newly created individual jpg files saved with quality 10 while maintaining sRGB and ICC profile to the destination folder and have PS automatically close the file. I would like to do this without the Save As dialogue box popping up for each and every file.
I have also attempted to use the Action with the Image Processor without success but am open to the easiest method.
​
​I can elaborate further as needed nut that is the simple gist of it.
​
​Please help me resume and finish my years long family photo cataloging project!
​
​Thank you so much for taking the time to help should you choose to. If you do not care to or are not sure about an item or two please do let me know and if possible point me to an appropriate resource to get me to the finish line.
​
​Regards, Sean
Copy link to clipboard
Copied
If you add in a save to your action it will save each file the same and the box won't pop up. A problem I have been running into is that when you use automate crop and straighten it saves the file automatically with the word "copy" afterwards because the automate crop and straighten function creates a copy and doesn't edit the original.