Hi!
With this code we can notify when file arrive in folder adding the code to Action Folder:
on adding folder items to this_folder after receiving added_items
try
set notification to ""
set filelist to ("") as Unicode text
set notifyTitle to ("") as Unicode text
tell application "Finder"
--get the name of the folder
set the folder_name to the name of this_folder
end tell
set the item_count to the number of items of the added_items
repeat with thisFile in added_items
tell application "Finder"
--get the name of the folder
set the file_name to the name of thisFile
end tell
if the filelist is "" then
set the filelist to the filelist & file_name
else
set the filelist to the filelist & ", " & file_name
end if
end repeat
if the item_count is 1 then
set notifyTitle to "Nuevo archivo en la carpeta " & the folder_name & ""
set notification to filelist & " ha sido añadido a la carpeta " & the folder_name & "."
else
set notifyTitle to "Nuevo archivo/s en la carpeta " & the folder_name & ""
set notification to filelist & " ha sido añadido a la carpeta " & the folder_name & "."
end if
tell application "System Events"
if (application processes whose name is "GrowlHelperApp") is not {} then
tell application "GrowlHelperApp"
register as application ¬
"Folder Actions" all notifications {"Added File"} ¬
default notifications {"Added File"} ¬
icon of application "Finder"
notify with name "Added File" title notifyTitle description notification application name "Folder Actions" icon of file this_folder with sticky
end tell
end if
end tell
end try
end adding folder items to
Anybody can help me? to show notifications when a file is modified and when a file is deleted??