• 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
Re: Correcting AGE_INFO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Correcting AGE_INFO


  • Subject: Re: Correcting AGE_INFO
  • From: Bert Groeneveld <email@hidden>
  • Date: Thu, 4 Feb 2010 11:21:24 +0100

Hello Mark, thanks for your answer.
Would you be so kind to put that into a real code block for me?

Bert.

On 4 feb 2010 (5), at 11:08, Mark J. Reed wrote:

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
  • Follow-Ups:
    • Re: Correcting AGE_INFO
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Correcting AGE_INFO (From: Bert Groeneveld <email@hidden>)
 >Re: Correcting AGE_INFO (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Correcting AGE_INFO
  • Next by Date: Re: set position does not works "as is"
  • Previous by thread: Re: Correcting AGE_INFO
  • Next by thread: Re: Correcting AGE_INFO
  • Index(es):
    • Date
    • Thread