(* Create a Today outline that lists today's iCal events Author: Steve Ivy Date: 04/12/2005 *) set theEvents to my todayEvents() tell application "Finder" -- or to the location you want. set gtdFolder to folder "GTD" of (path to home folder) set gtdPath to gtdFolder as string if exists file named "Today.oo3" of gtdFolder then open file named "Today.oo3" of gtdFolder end if end tell set today to current date set dateString to month of today & " " & day of today & Â ", " & year of today as string tell application "OmniOutliner Professional" if (exists document named "Today.oo3") then set todayDoc to document named "Today.oo3" else set todayDoc to make new document at beginning of documents end if tell front document delete every row make new row at end of rows end tell set topic of first row of todayDoc to dateString set topRow to the first row of todayDoc repeat with e in theEvents set newRow to make new row at the end of children of topRow -- return newRow tell application "iCal" set summ to the summary of e end tell set the topic of newRow to summ end repeat set the expanded of topRow to true set todayDocPath to gtdPath & "Today.oo3" save todayDoc in todayDocPath end tell -- ################################# -- on todayEvents() set today to (current date) -- or date "8/1/2004" set time of today to 0 -- midnight, if not --display dialog today as string set tomorrow to today + (1 * days) --display dialog tomorrow as string tell application "iCal" set dayEvents to {} repeat with c in (every calendar) repeat with e in (every event of c whose start date ³ today and start date < tomorrow) -- display dialog (the summary of e & "; " & the start date of e as string) set end of dayEvents to e end repeat --set end of dayEvents to (every event of c whose start date = today) end repeat end tell return dayEvents end todayEvents