Re: Scripting Now Up-to-Date
Re: Scripting Now Up-to-Date
- Subject: Re: Scripting Now Up-to-Date
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 10 Apr 2001 16:31:40 -0400
on 4/10/01 3:04 PM, Daniel Komrska jr. at email@hidden wrote:
>
I would like to tell to Now Up-to-Date 3.8.2 something like this:
The most recent public version of Now Up-to-Date is 3.9.2. I can answer your
question for a more recent version, but I don't know whether my answers will
work for earlier versions.
>
dear application
>
show me all events for Friday, April 20, 2001
>
thank you
This script will return a list of references to all events dated April 20,
2001.
tell application "Now Up-to-Date"
set eventsList to {}
tell calendar 1 of document 1
repeat with i from 1 to count every event
if startdate of event i is (date "4/20/01") then
set end of eventsList to event i
end if
end repeat
end tell
return eventsList
end tell
>
And second thing. I know how to get all events, thats no problem, but
>
I dont know, how to get theirs repetitions dates.
Repeating events in Now Up-to-Date are implemented as a list of "TimeBlock"
objects within the "Event" object. Most Events have only one TimeBlock, but
a repeating Event is one that has many TimeBlocks. The following script will
return a list of dates of all repetitions of a single event.
tell application "Now Up-to-Date"
set datesList to {}
tell event 1 of calendar 1 of document 1
repeat with i from 1 to count every timeblock
set end of datesList to startdate of timeblock i
end repeat
end tell
return datesList
end tell
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
The AppleScript Sourcebook - www.AppleScriptSourcebook.com
Vermont Recipes - www.stepwise.com/Articles/VermontRecipes