I have a Folder Action watching a folder to run an Applescript whenever a file is added to it.
The Applescript tells my thumbnail generator app to process the images. This works fine. The app creates a subfolder, and places the thumbnails inside.
The issue is that the Folder Action gets triggered for each image made in the subfolders, and it makes a thumbnail of the thumbnails in yet another subfolder.
This happens only once for some reason, but its still too much.
Is there a way I can set a Folder Action to ignore files added to its subfolders? I need to maintain this directory structure where the thumbnail generator outputs into a child folder.
Here's the script:
on adding folder items to this_folder after receiving added_items
repeat with eachItem in added_items
tell application "ThumbsUp" to open eachItem
end repeat
end adding folder items to
On another forum someone suggested this instead:
on adding folder items to this_folder after receiving added_items
repeat with eachItem in added_items
tell application "Finder" to set itsParent to (container of eachItem) as alias
if itsParent is this_folder then tell application "ThumbsUp" to open eachItem
end repeat
end adding folder items to
which should make ThumbsUp not run on items in the subfolder, but for some reason it continues with the same behaviour.
How can I stop folder action from running on subfolders?