Apple script date help

Is there some way to have a scrip which, checks for todays date, calculates how many days has passed since august 16 2010, and then divides the number of dates by 7, then checks for remainders. if the remainder is 1 it displays “a” if it is 2 then it displays “b” and so on?

im kind of new to applescripting so it would be great if someone could help

Hi,

try this, change the literal date string to a supported format in your international date format settings


property refDate : "16/8/2010"

tell date refDate to set referenceDate to it - (its time)
tell (current date) to set currentDate to it - (its time)
set daysLeftSinceReferenceDate to (currentDate - referenceDate) div days
display dialog character ((daysLeftSinceReferenceDate mod 7) + 1) in "gabcdef"

I hope that in your country a week has 7 days :wink:

is there a way to change the display from characters to dialogs?

what kind of dialogs?

i meant instead of only having characters, btw i got it to work, thx though.