Hi,
I have a script that I designed to monitor a server folder for new items. When it sees a new file in the folder, it copies the file to the local HD (to performs some tasks in Photoshop). After the file gets copied to the HD, the script deletes it from the server.
The script is having this arbitrary problem. Sometimes, it seems to try and delete the file from the server before it’s done copying down. I get the Finder message “Can’t move XXX to the trash, because the file is busy…”. It’s hard for me to pinpoint exactly what the problem is, because there’s no noticeable pattern. I can redo the same thing with the same file, and it works.
So, is there a way to prevent the script from trying to delete the file from the server before the file is done copying down? I’ve tried playing with ‘busy status,’ without success.
The gist of my script is simple:
--If the script sees a file in the server folder:
tell app "finder"
move aFile to localFolder
delete aFile
end tell
Thanks,