Watch Folder for Newly Added Items

[Code Exchange is a section reserved for sharing successful solutions. Moved to AppleScript | OS X for help with a problem.]

I have a current script I use to create a New Project folder with a set of sub-folders. What the script does is prompt me to enter a Project Number and Project Name for the new folder. The script continues by adding a set of subfolders that are tagged with the Project Number (see script below).

–Make a choice for server folder type–
display dialog ¬
“Select New Project to Start or Cancel Process” buttons {“New Project”, “Cancel”}
set the button_pressed to the button returned of the result

–To make New Project server–
if the button_pressed is “New Project” then

-- Prompt for a prefix.
set prefix to text returned of (display dialog "Please enter a job number for the project folder names." default answer "Project Number-" with icon note)
if prefix does not end with "-" then set prefix to prefix & "-"

-- Use a "Save as." dialog to set the name and location for this project folder.
set parentFolder to (choose file name with prompt "Enter a Project Name & Pick a Destination" default name (prefix & "Enter Project Name Here"))
set parentPosix to quoted form of POSIX path of parentFolder

-- Assemble the mkdir command.
set astid to AppleScript's text item delimiters
set AppleScript's text item delimiters to ""
set mkdirStr to {"mkdir -p ", parentPosix, "/", prefix, "{Comps,Copy,Images,Collected,Reference,PDF}"} as Unicode text
set AppleScript's text item delimiters to astid

-- Create the folders.
do shell script mkdirStr

-- tell application "Finder" to open parentFolder

Wish List:

I would like to tag a Watch Folder to run a similar script when something new is added to it. In this case, everytime I add a New Project folder to the Watch Folder, the script would automatically run and 1. Add the needed subfolders {Comps,Copy,Images,Collected,Reference,PDF} to the New Project folder, 2. Tag each subfolder with a prefix number taken from the New Project folder name.

For example:
New Project folder name = Project Name (888229922)
Subfolders added inside of Project Name (888229922) = 888229922-Comps, 888229922-Copy, 888229922-Images, 888229922-Reference, 888229922-PDF

The script would have to stop so that it is not triggered to run again once the subfolders are added being that the Watch Folder is told to run the script everytime a new item is added to it. So the script would only run when the initial New Project folder was created inside the Watch Folder.

I hope this makes sence. Would appreciate some scripting help and would love if this helps someone else with this topic. :smiley:

aepasieka

Model: Power PC G4
AppleScript: 1.10.6
Browser: Safari 417.9.3
Operating System: Mac OS X (10.4)