Okay, I’ve got a pretty cool folder action script working. But the on “on adding folder items to” handler does not get called if the file being dropped already exsits. In fact, the folder action script doesn’t even launch if the file “being added” is replacing a file that already exists into the folder action folder. Is there anyway to make this work?
Delete the existing file first?
– Rob
OK, after viewing this response the first time and not coming across any other posts on the issue, I wrote a script that I attached to a drop folder that basically searched throughout all my job folders until it found the matching file and put it in the Trash, then moved the new file to the Trashed file’s previous location in order for the folder action to fire correctly. This worked alright, however it errored if it didn’t find a duplicate file to replace using the trash-then-move method, so I incorporated that into the script. Then there were certain files that for no apparent reason would not cause this workaround to work correctly so I started working on that. Then I came back to my original thought”why am I doing all this as a workaround when the action should simply respond to the file being droped in the original folder, even if replacing an existing file? The workaround script needs to check every job folder until it finds the file it needs to replace, and at the rate my numbers of job folders are being created it’s starting to take more and more time. The purpose of my original folder action is automation, so going into the Finder to delete the file I’m replacing defeats the purpose of having the folder action at all. The original post is a couple years old, if anyone has come across a solution to this shortcoming it would be greatly appreciated if they shared some insight. My workaround script is becoming more and more rediculous as it shouldn’t be needed at all.
Model: Dual 2 GHz PowerPC G5
AppleScript: 1.10.7
Browser: Safari 419.3
Operating System: Mac OS X (10.4)