
We need a simple applescript written to run a single batch command in Adobe Photoshop CS3
SEE THE VIDEO DEMONSTRATION HERE - http://think-a-doo.net/node/107
This version of the script was good enough to get the job done the next day, but needs a lot of refinement to make it more friendly to use in the studio.
1. I will add dialogue boxes to ask you what the name is of your Photoshop Action as well as where the Action is located in Photoshop.
2. I left "--" comments where I need to add dialogue boxes or spoken feedback for specific error conditions, which we did not anticipate being a problem in the job for which I wrote the script. I will add these later.
3. The next refinement will be to write a complete module for the File Output Choice. At the moment it is "hard coded" to JPEG with no specific attributes. Photoshop CS3 offers a wide range of choices to applescript with a comprehensive set of parameters for the quality of the output. This will take longer to do.
Feel free to contact me if you have any specific requirements. andre.n.venter@gmail.com
-- SCRIPT
set fileCounter to 0
-- This chooses the master folder where all your sub folders with images are stored
say "Choose your Master Folder for this batch job"
set mfolder to choose folder
-- This chooses the destination folder where all your result images are stored
say "Choose your destination Folder for the processed files"
set dfolder to choose folder
-- This checks when the batch started and stores the date value
set startTime to time of (current date)
-- List of the content of the master folder
tell application "Finder"
launch
set folderList to folders of (mfolder) as alias list
set resultsFolder to make new folder at dfolder with properties {name:"Results"}
end tell
-- this loop will repeat through all the folders - only one level deep
repeat with i from 1 to (number of folderList)
-- Set the sub folder to next folder in aList
set sFolder to item i of (folderList)
tell application "Finder"
launch
set assetsFolder to make new folder at resultsFolder with properties {name:"Processed Images " & i}
set fileList to files of (sFolder) as alias list
end tell
--return (assetsFolder) as alias
repeat with j from 1 to (number of fileList)
set wFile to item j of (fileList)
set fileCounter to fileCounter + 1
-- This tells photoshop which action from which group to execute
tell application "Adobe Photoshop CS3"
try
open (wFile)
on error
--
end try
try
do action "Your Actions Folder" from "Your Action Name"
on error
--
end try
try
save current document as JPEG in ((assetsFolder) as alias)
on error
--
end try
try
close current document
on error
--
end try
end tell
end repeat
end repeat
set endTime to time of (current date)
return "I took " & endTime - startTime & " seconds" & " to complete the batch containing " & fileCounter & " files."
-- END
Comments
CS 3 Batch jobbing
Thanks Andrew, I tried it, but alas, I have upgraded to Snow Leopard on my MacBookAir and it aint happy. It crashes and burns !
Peter
Snow Leopard
The whole applescript engine is new in Snow Leopard. It is now integrated with XCode so you can develop full applications using applescript... Maybe that is the reason.
I developed this script on OS X 10.5.8 for Photoshop CS3. I don't have CS3 on a Snow Leopard machine so cannot test it for you. I will have a look when we see each other again.