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: Nigel Garvey <email@hidden>
- Date: Tue, 18 Mar 2003 12:41:12 +0000
Michelle Steiner wrote on Mon, 17 Mar 2003 17:39:10 -0700:
>
On Monday, March 17, 2003, at 04:39 PM, Daniel wrote:
>
>
> 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
>
>
date -1 returns one second earlier than when the script is run. Try
>
date - 30 * days minutes, hours, days, and weeks are defined
>
constants. Unfortunately, months is not because the number of seconds
>
in a month varies, depending upon which month it is. So, if you don't
>
have to be exact for one month, 30 days may be a reasonable substitute.
If by "within the last month", Daniel meant "since this day last calendar
month", the following may help. It returns 00:00 on the day in question.
If this day doesn't exist in the previous month, it returns the first day
of this month instead.
tell (current date)
set thisMonth to its month
set {year, day, day, time} to {year - 1, 352, day, 0}
if its month is thisMonth then set its day to 1
set aMonthAgo to it
end tell
NG
_______________________________________________
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.