home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-03-31 | 1.9 KB | 61 lines | [TEXT/ToyS] |
- global uStart, uDays
- set uStart to (current date)
- set uDays to 7
-
- on DateString(dateobj)
- set str to every word of (dateobj as text)
- set dstr to ""
- repeat with i from 1 to the (number of items in str) - 3
- if (i is not 1) then set dstr to dstr & " "
- set dstr to dstr & item i of str
- end repeat
- return dstr
- end DateString
-
- with timeout of 3600 seconds
- display dialog ¬
- "Please input starting date" default answer ¬
- "1999/1/1" buttons {"Cancel", "Ok", "Today"} default button 2 with icon 1
- set uAns to result
- if (button returned of uAns) is "Cancel" then return
- if (button returned of uAns) is "Today" then
- set uStart to (current date)
- set uStart to uStart - (time of uStart)
- else
- set uStart to date (text returned of uAns as text)
- end if
-
- display dialog ¬
- "How long days do you need?" default answer (uDays as text) ¬
- buttons {"Cancel", "Ok"} default button 2 with icon 1
- set uAns to result
- if (button returned of uAns) is "Cancel" then return
- set uDays to (text returned of uAns as number)
-
- set uFile to new file with prompt "Output:" default name my DateString(uStart)
- set fh to open for access uFile with write permission
- try
- repeat uDays times
- tell application "uCalendar"
- -- if do not open the calendar, get schedule from the front calendar
- --open {alias "Mac:1999 Calendar"}
- set uMemo to GetMemo on uStart
- end tell
- if (length of uMemo is not 0) then
- write "--------------------------" & return to fh
- set uText to my DateString(uStart) & return & "--" & return
- repeat with i from 1 to the number of items in uMemo
- set uText to uText & item i of uMemo & return
- end repeat
- write (uText) to fh
- display dialog uText buttons {"More"} default button 1 with icon 1
- end if
- set uStart to uStart + days
- end repeat
- close access fh
- display dialog "Complete" buttons {"OK"} default button 1 with icon 1
- on error errMsg
- close access fh
- error errMsg
- end try
- end timeout