I don't get it...

I haven’t touched AppleScript in years so I need to start again. I am tring to write a Folder Action script. This script/folder needs to take a captured Quicktime move, create a folder with the name of the movie (I name the movie), move that movie into the new folder, create one folder called “sequences” and another called “audio”, but inside the new folder. Then the script calls Quicktime to export the frames of the movie and put them into the folder called “sequences” and extract the audio and put it into the folder called “audio”. So, we have the following heirarchy:


So far I have:

on adding folder items to capture_folder after receiving captured_movie
tell application “Finder”
make new folder at folder capture_folder with properties {name:captured_movie}
end tell
end try
end adding folder items to

Instead of a folder called “captured movie” I get dozens, if not hundreds, of folders named “untitled folder 1”, “untitled folder 2”, etc. Can anybody tell what is going on? I don’t understand why there is this loop of creating folders.

Thanks for your help.

ol’ scripter

When you create the new folder at ‘folder capture_folder’, the Folder Actions system notices the new addition and retriggers the script, which creates another new folder, which… :slight_smile:

The same can also happen if an existing item in the folder is renamed. It’s best to create any new items somewhere else.

Ah!!! Duh… Now it makes sense. I guess I can have the action make the folders outside the capture folder and create the frames, etc. Thanks for your help Nigel.