Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Prints out the current day (Sun, Mon) first and then
- # the rest of the week. If you want to make it say
- # Sunday instead of Sun just change it in the function
- # on numToDate(num)
- #
- # By Kyle Brodie
- set d to weekday of (current date) as integer
- set str to ""
- set str to str & numToDate(d)
- repeat with index from 1 to (7 - d)
- set str to str & " " & numToDate((d + index))
- end repeat
- repeat with index from 1 to (d - 1)
- set str to str & " " & numToDate(index)
- end repeat
- return str
- on numToDate(num)
- if num = 0 then
- return "ERROR"
- else if num = 1 then
- return "Sun"
- else if num = 2 then
- return "Mon"
- else if num = 3 then
- return "Tue"
- else if num = 4 then
- return "Wed"
- else if num = 5 then
- return "Thu"
- else if num = 6 then
- return "Fri"
- else if num = 7 then
- return "Sat"
- end if
- end numToDate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement