I activated the folder action provided by apple (modified to send an email) on the Drop Box inside the Public folder of my account on a file server (Mac OS X 10.2.6).
If I am logged in at the server it works. If not, it does not.
Here is the code. Thanks for help, David
on adding folder items to this_folder after receiving added_items
try
– find out how many new items have been placed in the folder
set the item_count to the number of items in the added_items
-- determine phrase at plural or singular
if the item_count is greater than 1 then
set theDropped to (the item_count as text) & " new items"
else
set theDropped to "One new item"
end if
set theSubject to theDropped & " in your dropFolder"
set messageBody to "DropFolder Notification" & return & return
set messageBody to messageBody & theDropped & " in the dropFolder" & return & return
repeat with currentItem in added_items
set messageBody to messageBody & " - " & currentItem & return
end repeat
set mailCommand to "echo " & messageBody & " | mail -s dropFolder dz"
do shell script mailCommand
end try
end adding folder items to