Tente isto:
set time1 to do shell script "perl -e 'use Time::HiRes qw(time); print time'"
set d to do shell script "date +%d-%m-%Y"
tell application "Finder"
set dir to POSIX file "/Volumes/Xsan/PathTo/Folder" as alias
set eContents to entire contents of dir
repeat with f in my eContents
if comment of f does not start with "Archived" then
set comment of f to "Archived " & d
set label index of f to 2
end if
end repeat
end tell
set time2 to do shell script "perl -e 'use Time::HiRes qw(time); print time'"
set millisec to (round ((time2 - time1) * 1000))
ou
set time1 to do shell script "perl -e 'use Time::HiRes qw(time); print time'"
set d to do shell script "date +%d-%m-%Y"
tell application "Finder"
set dir to POSIX file "/Volumes/Xsan/PathTo/Folder" as alias
set eContents to every file of (entire contents of dir) whose comment does not start with "Archived"
repeat with f in my eContents
set comment of f to "Archived " & d
set label index of f to 2
end repeat
end tell
set time2 to do shell script "perl -e 'use Time::HiRes qw(time); print time'"
set millisec to (round ((time2 - time1) * 1000))