Applescript for PS actions

OK, I have tried and tried with no success to script this COMPLETELY, but have never been successful. I have part of it scripted using PS actions and AS, but not all of it. Here is what the deal is. I am a photographer that creates custom booklets of images for clients. Each booklet has pages with images in different configurations on them. I have scripted each page of the booklet and that works great, but I can not get the whole thing scripted.

Here is what I do. I have a folder on my HD that is called booklet images. And in that folder is a sub-folder for each page of the booklets, for example one sub-folder would be called cover. This designates that the booklet page is the cover. Inside this cover folder is another level of sub-folders that designate where each image goes on the cover page. In other words the cover sub-folder has 6 sub-sub-folders named 1,2,3…6. I place the images in these folders for where I want them to appear on the cover. (see below)

I have each page scripted where I launch a script named “cover”, or whatever the booklet page name is, and it will open up each image in PS, place it on the booklet page in the proper position, save it to the finished folder, and close.

What I have been trying to do unsuccessfully is to get a master script that I can have that will go through and find folders (or sub-sub-folders) with images in them, launch the corresponding script, wait for that script to finish, then move on down the line. At the end of the script have it move all the image files from the sub-sub folders into another folder, named OLD, this for easy clean-up.

I tried using Folder Actions -when an image was placed in a sub-sub folder, it would then move the script into a master folder named SCRIPTS TO RUN,that I could then run from. That however seemed to slow my machine down terribly. Also, I was never able to write a script that could run all the scripts in that master folder, pausing waiting for one to finish before launching the next.

I know this post is long and probably difficult to understand, however I would save hours if I could get some help with this.

Any help would be greatly appreciated.

TIA

Kelly Sansom

Oh c’mon there has to be somebody out there that can help me. I’m definentely not expecting someone to just write a fix-all script for me, so if there is any info that you can pass on! Anything would be helpful.

Maybe let me disect my questions, so that if anyone can answer them individually they can:

Question 1: Have a script go through and find folders (or sub-sub-folders) with images in them, launch a corresponding script, wait for that script to finish, then move on down the line. Anyone know how to do this? I have tried using timers, but it doesn’t always take the same amount of time to finish.

Question 2: At the end of the script have it move all the image files from the sub-sub folders into another folder, named OLD, this for easy clean-up. This isn’t imperative, because I can manually remove them, but isn’t AS supposed to take the “manually” out of repetitive tasks?

Please!! Anyone with any help would be appreciated.

Thanks again.

Kelly Sansom

I am fairly new to AppleScript and its nuances but found something similar to what you are asking.

tell application “Finder”
set file_type to (files whose name contains “.iPhoto”) of disk “System
repeat with the_file to folder “System:PhotoAlbum:
end repeat
end tell

You would want to change the “.iPhoto” to the file type, System to what ever you named your hard drive, and System:PhotoAlbum to your target directory structure.