Moving from Microsoft Office VBA to AppleScript:
MacTech's Guide to Making the Transition
Introduction
|
Table of Contents
Page Prev and Page Next buttons at bottom of the page.
|
April, 2007
Page 134
location, start time, has reminder, remind time, recurring, ¬
recurrence, category, project list, content, links}
(*if it's a recurring event, find when the next
occurrence is due and make that the start time *)
if recurring of theEvent then
set now to (current date)
copy now to checkDate -- copy, not set
set year of checkDate to ((year of checkDate) + 1)
-- a year from now
set allOccurrences to calculate recurring dates for ¬
theEvent from theStartTime to checkDate
set nextOccurrence to missing value -- initialize
repeat with i from 1 to (count allOccurrences)
set thisOccurrence to item i of my allOccurrences
if thisOccurrence > now then -- first occurrence after now
set nextOccurrence to thisOccurrence
exit repeat
end if
end repeat
if nextOccurrence = missing value then exit repeat
-- skip, since no longer occurring
set theStartTime to nextOccurrence -- forget occurrences in the past
end if
(*need to convert from event remind time (minutes before
event as integer) to precise remind date and time,
as date object, for task) *)
if hasReminder then set theReminder to ¬
(theStartTime - (theReminder * 60))
< Previous Page Next Page>
- SPREAD THE WORD:
- Slashdot
- Digg
- Del.icio.us
- Newsvine