I’ve been attempting to set up a watch folder script for a location on a network volume.
The trouble I’m having is getting the script to alert me (or anyone else) to list only the new files in the folder and to ignore existing files since the last time it checked. I don’t want to set this up as a folder action (so I don’t need to keep the window open). I think I’m using the correct check_files(new_file_list) handlers and folder_to_watch settings, but when I run and test the script it doesn’t alert me to added items. I also have a return (value) line and on idle, end idle lines for it to periodically check the folder in question to compare the previous list with the current list, and I set it up to show an error_message with the specified text and name of the folder it is watching, and a count of the new items.
But for some reason, it doesn’t seem to work correctly.
Can anyone offer a suggestion?
Has anyone gotten this type of thing to work correctly before?
Any help would be greatly appreciated.
It can be done, but it sounds like you’re using the script from AppleScript for Dummies. In order for a folder watching script to really work you are going to have to have Mac OS 9 or later so that the script can alert you via remote events. The script should be running ( and stay open ) on the server where the specific folder resides. On idle it should check for new files by comparing the current file to a list of the files that were there the last time it checked. When it finds some thing new it should…
tell application "Finder" of computer "YourComputer" in AppleTalk Zone "YourZone"
display dialog "Hey pal, There's a new file!"
end tell
… or at least I think that’s the syntax. You can also use IP adresses to direct AppleEvents to remote computers.