Folder Actions

timhill

Registered
G,Day,
I would be stoked if someone could provide me with or point me in the right direction of a folder action script that will
add-new-AND- modified item alert.
I can run the add-new item alert.scpt
I need a scpt that will do this as well as alert if files are modified in a folder.

Any assitance would be greatly appreciated. Some of my staff are being driven nuts by a few inhouse clients who are updating files and then saying they didn't do it etc.

Cheers, tim
 
As far as I know, there's no way to do this with Folder Actions. However, you can create a non-Folder-Action script to repeatedly check a folder's contents for newly modified documents. Something like this ought to do the trick:
Code:
global latest_date
global folder_to_check
on run
	set latest_date to the current date
	
	tell application "Finder"
		set folder_to_check to the desktop --change 'the desktop' to the folder you want to monitor
	end tell
	idle
end run

on idle
	tell application "Finder"
		set date_list to every item of folder_to_check
		set new_latest_date to the current date
		repeat with x in date_list
			if the modification date of x > latest_date then
				--x has been modified/created, so now we should do something with it
				display dialog "Item " & the name of x & " has been modified"
			end if
		end repeat
		set latest_date to new_latest_date
		return 5 -- wait 5 seconds before checking again
	end tell
end idle
Save that as an application, making sure to check the "Stay Open" button in Script Editor's save dialog, and then launch it. It will bring up a dialog telling you about every item you modify/create on the desktop.

hope this helps.
 
Back
Top