Re: Problem with modification date of file...
Re: Problem with modification date of file...
- Subject: Re: Problem with modification date of file...
- From: Mr Tea <email@hidden>
- Date: Wed, 13 Nov 2002 17:12:05 +0000
This from David Crowe - dated 131102 04.00 pm:
>
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
Are you sure that worked, ever, David? At the very least, 'current date'
should be in brackets, and I don't understand the purpose of the script, as
it will only 'get' files whose modification date is the exact precise second
that the script is running. You're unlikely to turn up too many of those.
>
The error that I get is:
>
--> Finder got an error: Can't make some data into
>
the expected type.
There is a problem, however with digging out the information about
modification dates from items in a list. You need to do a little bit of
extra coercion there. Try this:
--==========================================
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
newFiles
--==========================================
HTH
Mr Tea
--
Brew of the day: Twinings Orange Pekoe
_______________________________________________
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.