Re: Problem with modification date of file...
Re: Problem with modification date of file...
- Subject: Re: Problem with modification date of file...
- From: John Delacour <email@hidden>
- Date: Sat, 16 Nov 2002 14:58:23 +0000
- Mac-eudora-version: 5.3a9
At 9:00 am -0700 13/11/02, David Crowe wrote:
Another apparent OSX 10.2 AppleScript problem.
The following scriptlet doesn't work (but did under OS 9)
tell application "Finder"
get every file of folder "xyz" of startup disk whose
modification date = current date
end
The error that I get is:
--> Finder got an error: Can't make some data into
the expected type.
Note that this works with <<...whose name contains "a">>, so this
appears to have something to do with modification date.
I can't think of a workaround to this either.
It's presumably a bug, but here's a workaround:
set d to (current date) - {3 * days}
set ls to {}
tell application "Finder"
set fo to folder "cgi-bin" of startup disk
set {n, m} to get {name, modification date} of files in fo
repeat with i from 1 to count m
if item i of m is less than d then
set hit to item i of n
set end of ls to file hit of fo
end if
end repeat
end tell
return ls
_______________________________________________
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.