Permalink
Browse files

Add Christmas and Sundays scripts

  • Loading branch information...
1 parent 2923976 commit 70c318e616ca199a1554a3278c998e24b1542746 @zachwill committed Jun 1, 2012
Showing with 27 additions and 0 deletions.
  1. +9 −0 christmas.applescript
  2. +18 −0 sundays.applescript
View
@@ -0,0 +1,9 @@
+#!/usr/bin/osascript
+
+-- What day will Christmas be on this year?
+
+set Christmas to (current date)
+set month of Christmas to December
+set day of Christmas to 25
+
+linefeed & "Christmas this year will be on a " & weekday of Christmas & "."
View
@@ -0,0 +1,18 @@
+#!/usr/bin/osascript
+
+-- All of the years Christmas will land on a Sunday.
+-- Taken from here: http://rosettacode.org/wiki/Day_of_the_week#AppleScript
+
+set sundays to {}
+set Christmas to (current date)
+set month of Christmas to December
+set day of Christmas to 25
+
+repeat with year from 2008 to 2200
+ set year of Christmas to year
+ if weekday of Christmas is Sunday
+ set end of sundays to year
+ end if
+end repeat
+
+sundays

0 comments on commit 70c318e

Please sign in to comment.