Title: Re: Share calendar?
And another issue is getting to-do items out of Entourage. I have a script that exports calendar items from Entourage and puts them into Excel (you have to manually set the date range), but nothing that will get tasks out of Entourage. I don't know where I got this script, I think it was appended to a message on this mailing list.

This is the script, I've tried it and it works, though I don't know why or how. If anyone knows how to modify this to do the same thing for task (to-do) items, I'd be really interested. Anyway, here is the script that I received from???

set startdate to date "Sunday, December 3, 2000 12:00:00 AM"
set EndDate to date "Friday, December 15, 2000 12:00:00 AM"
set RowNum to 2
set ods to AppleScript's text item delimiters --
the default {""} normally
set AppleScript's text item delimiters to {", "}
tell application "Microsoft Excel"
    Activate
end tell

tell application "Microsoft Excel" to set FormulaR1C1 of Range "a1:g1" to {"Start", "End", "Duration", "Subject", "Description", "Category", "Location"}
tell application "Microsoft Entourage"
    set searchResults to every event whose start time ¬
        is greater than startdate and ¬
        start time is less than EndDate
    
    if (count of searchResults) > 1 then
       repeat with theEvent in searchResults
            set sStart to start time of theEvent
            set EEnd to end time of theEvent
            set Ssubject to subject of theEvent
            set Lloc to location of theEvent
            set Desc to content of theEvent
            set theCats to category of theEvent
            if theCats = {} then
               set catNames to "None"
            else
               set catNames to {}
                repeat with aCat in theCats
                    set end of catNames to name of aCat
                end repeat
               set catNames to catNames as string
            end if
           set sRange to "r" & RowNum & "c1:r" & RowNum & "c7"
            tell application "Microsoft Excel" to set FormulaR1C1 of Range sRange to {sStart, EEnd, "=24*(rc[-1]-rc[-2])", Ssubject, Desc, catNames, Lloc}
            set RowNum to RowNum + 1
        end repeat
   end if
   set AppleScript's text item delimiters to ods --
restore delimeters
end tell


I think this is supposed to open Excel, but I have found the script only works if Excel is already open with a new document. Maybe that gallery screen gets in the way?

Jonathan

Reply via email to