I would like to automate a function with Photoshop. I want to run a sharpening process on all image files in a directory. I would start on the first file and do all files in order. How do I get the script to iterate down the file list? I am opening a file in one directory sharpening it and then saving it in another directory and then want to loop and do this again on the next file in the first directory. I will end up at the end with the files duplicated in the second directory and all sharpened.
Thanks for any ideas.
David Egolf
Running a script on all files in a Directory
Moderators: Dorian (MJT support), JRL
I've been using a slightly easier (to me) method for this, by piping a DIR command into a text file.
Try this:
run>cmd.exe /c dir /b *.jpg > c:\temp\filelist.txt
filelist.txt now contains a list of the files which can be scanned using readln.
The /b switch for dir returns only the file name without the extra information.
Hope that helps,
Ian
Try this:
run>cmd.exe /c dir /b *.jpg > c:\temp\filelist.txt
filelist.txt now contains a list of the files which can be scanned using readln.
The /b switch for dir returns only the file name without the extra information.
Hope that helps,
Ian
Ian
What a great tip! Use /c to get file name only. I been doing dos for 20 years and never came across that. I have used the dir > temp.txt for years to get a directory into a file and then had to write the prorgam to get rid of all the other un-necessary directory junk. Thanks again. I wil be using that a lot. Ok all you old dos guys you probably knew this long ago, but I just learned.
Tom
What a great tip! Use /c to get file name only. I been doing dos for 20 years and never came across that. I have used the dir > temp.txt for years to get a directory into a file and then had to write the prorgam to get rid of all the other un-necessary directory junk. Thanks again. I wil be using that a lot. Ok all you old dos guys you probably knew this long ago, but I just learned.
Tom
Degolg,
They have a lot of absolutely great batch scripts for photoshop within the photoshop environment. Not to say mjt macro won't work great also, but I have used the batch processing there and they drill down just like you wouldn't believe. Its almost like the mjt recorder that works so well here, but the batch for photoshop is designed just for photoshop. You can find a lot of samples on the web under "photo shop batch processing".
Maybe you already looked at batch and it wouldn't work for you. This is not the dos batch we all know so well.
Tom
They have a lot of absolutely great batch scripts for photoshop within the photoshop environment. Not to say mjt macro won't work great also, but I have used the batch processing there and they drill down just like you wouldn't believe. Its almost like the mjt recorder that works so well here, but the batch for photoshop is designed just for photoshop. You can find a lot of samples on the web under "photo shop batch processing".
Maybe you already looked at batch and it wouldn't work for you. This is not the dos batch we all know so well.
Tom
- CyberCitizen
- Automation Wizard
- Posts: 721
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia