Re: Sorting list of calendar events
Re: Sorting list of calendar events
- Subject: Re: Sorting list of calendar events
- From: Shane Stanley <email@hidden>
- Date: Thu, 16 Apr 2015 21:50:25 +1000
On 16 Apr 2015, at 5:48 pm, Jan Erik Moström <email@hidden> wrote:
I use this line to get the events
set theEvents to every event whose ((start date of it) ≥ (todayDate) and (end date of it) ≤ (tomorrowDate))
but how to I do the sorting?
First off, you should be aware that your statement won't return any recurring events that happen to recur in your time range. Second, there's no direct way to sort Calendar events in AppleScript. You probably need to get the start date of the events, plus whatever other properties you want, combine them into lists, and then sort by start date using your favorite AppleScript sorting routine.
The alternative, if you're running Mavericks or Yosemite, is use AppleScriptObjC and script the event store directly. That gets you all the events, and includes a method for sorting them. I posted a basic script for it here a while back, but yell if you're interested and I'll update it to do the sorting. I just need to know what information you want from the events.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden