Why the speed difference? (was: Problem with modification date of file...)
Why the speed difference? (was: Problem with modification date of file...)
- Subject: Why the speed difference? (was: Problem with modification date of file...)
- From: Mr Tea <email@hidden>
- Date: Wed, 13 Nov 2002 19:50:35 +0000
After posting this script:
--==========================================
set dateStr to date string of (current date)
set newFiles to {}
tell application "Finder"
set theFiles to every file of folder "xyz" of startup disk
repeat with aFile in theFiles
set theProps to properties of aFile
set theDate to date string of modification date of theProps
if theDate = dateStr then set end of newFiles to aFile as alias
end repeat
end tell
--==========================================
... I dabbled around with alternative ways of doing the same thing and
produced this:
--==========================================
set dateStr to date string of (current date)
set newFiles to {}
set theFolder to alias [path to folder]
set theFiles to list folder theFolder without invisibles
tell application "Finder"
repeat with aFile in theFiles
if exists file (aFile as string) of folder theFolder then
set theDate to modification date of file (aFile as string) of folder
theFolder
set theFileDate to date string of theDate
if theFileDate = dateStr then set end of newFiles to ((theFolder as
string) & aFile) as alias
end if
end repeat
end tell
--==========================================
It does the same job and gets the same end result, but in about a third of
the time that the first script takes. Why the speed difference?
Regards
Mr Tea
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.