Correcting AGE_INFO
Correcting AGE_INFO
- Subject: Correcting AGE_INFO
- From: Bert Groeneveld <email@hidden>
- Date: Thu, 4 Feb 2010 10:43:21 +0100
set D to current date tell application "Finder" set M to modification date of alias myFile -- myFile was of course set to some file earlier in the script end tell set AGE_INFO to round (D - M) / days rounding up -- is always an integer set 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. |
_______________________________________________
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