folder action: add - set modification date
folder action: add - set modification date
- Subject: folder action: add - set modification date
- From: Jens Wettermann <email@hidden>
- Date: Fri, 2 Nov 2001 15:09:00 +0100
Hi,
I wrote this tiny script that - attached to a folder - changes the
modification date of incoming files to the current date:
property copy_checks_indicator : false
on adding folder items to this_folder after receiving added_items
try
if copy_checks_indicator is true then
-- CHECK THE FILES TO MAKE SURE THEY'RE COMPLETELY AVAILABLE
set the added_items to my check_added_items(the added_items)
if the added_items is {} then return "no vaild items"
end if
tell application "Finder"
repeat with this_item in the added_items
set the modification date of this_item to the current date
end repeat
end tell
end try
end adding folder items to
The script works fine on my local 9.2.1 and even if somebody else
mounts my local folders on his Mac using file sharing the script sets
the modification date correctly. But the script must run on another
machine (9.0.4) which mounts a volume using file sharing too. Okay,
to make a long story short ... the problem is that the modifcation
date is correctly set to the current date (and time) when the copy
process starts. Unfortunately the modification date of that file is
set back to it's former date after the copying is finished.
I'm pretty new to AppleScript and I'd very much appreciate your hints on this.
Thanks in advance,
Jens