Re: Correcting AGE_INFO
Re: Correcting AGE_INFO
- Subject: Re: Correcting AGE_INFO
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 4 Feb 2010 05:08:24 -0500
Well, you could start by doing age_info - 2* age_info div 7.
Then just count backwards (age_info mod 7) days from now and subtract
any weekends in there.
On Thursday, February 4, 2010, Bert Groeneveld
<email@hidden> wrote:
> set D to current datetell application "Finder" set M to modification date of alias myFile -- myFile was of course set to some file earlier in the scriptend tellset AGE_INFO to round (D - M) / days rounding up -- is always an integerset AGE_INFO to correct_AGE_INFO(AGE_INFO, D, M)
> on correct_AGE_INFO(AGE_INFO, D, M) -- what to put here? (as less code as possible, of course)end correct_AGE_INFO
> Hello,I'm breaking my head about finding some "super algorythm" for this:I want to correct AGE_INFO, by omitting the days of the weekend (saturday and sunday)Three possible examples (among many others):If the weekday of D is thursday and the weekday of M is friday and AGE_INFO is 7, then I want to correct AGE_INFO by -2 (one weekend in between)If the weekday of D is tuesday and the weekday of M is friday and AGE_INFO is 12, then I want to correct AGE_INFO by -4 (2 weekends)If the weekday of D is wednesday and the weekday of M is monday and AGE_INFO is 3, then I want to do nothing.
> Thanks in advance for any help,
> Bert.
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden