• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Correcting AGE_INFO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Correcting AGE_INFO
      • From: "email@hidden" <email@hidden>
    • Re: Correcting AGE_INFO
      • From: Luther Fuller <email@hidden>
    • Re: Correcting AGE_INFO
      • From: Deivy Marck Petrescu <email@hidden>
    • Re: Correcting AGE_INFO
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: Re: Finder BUGS?
  • Next by Date: Re: Correcting AGE_INFO
  • Previous by thread: Re: Finder BUGS?
  • Next by thread: Re: Correcting AGE_INFO
  • Index(es):
    • Date
    • Thread