Re: Get ID of items Modified with 1 month
Re: Get ID of items Modified with 1 month
- Subject: Re: Get ID of items Modified with 1 month
- From: John Delacour <email@hidden>
- Date: Tue, 18 Mar 2003 00:31:58 +0000
- Mac-eudora-version: 6.0a11
At 9:39 am +1000 18/3/03, Daniel wrote:
How to I write the following:
get id of every item of the entire contents of folder "untitled" whose
modification date is less than date -1
This doesn't stop the script, but it doesn't return any result
--> by this I need the ID of all files of a folder modified within the last
month.
I don't think you can do it without a loop if you're using 'entire
contents'. If you want to look only at the top level, then you can
do it in one go.
Pick a folder (not one with gigabytes of stuff) in the Finder and run this:
set d to (current date) - 1 * days
tell application "Finder"
set sele to get selection as alias
set ls to {}
repeat with i in entire contents of sele
if modification date of i is less than d then
set end of ls to (contents of i) as string
end if
end repeat
return ls
end tell
also I am trying to work out what "ldt " means. when i use:
select folder "untitled folder"
set name of selection to the date
it makes the folder name "ldt_"
_ = space
date is <<class ldt >> which stands for long date. What you are
seeing is the class as string, which is useless to you. See the
script above to see how to do it.
Im trying to get a value which will make the name of "Untitled folder" to
"1/12/02 - 1/01/03"
sure I could do that manually, but that takes the fun out of scripting.
It'll take the fun out of computing if you do it in OS 10. Slashes
are illegal in file names.
_______________________________________________
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.