• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sorting list of calendar events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting list of calendar events


  • Subject: Re: Sorting list of calendar events
  • From: Christian Boyce <email@hidden>
  • Date: Thu, 16 Apr 2015 07:22:53 -0700
  • Sendlaterdate: Thu, 16 Apr 2015 07:22:51 -0700

Here's how I do it-- been running this script automatically for five years.

http://christianboyce.blogspot.com/2009/09/your-appointments-sir_4544.html

The part of my script that does the sorting is here:

-- This is the sorting subroutine. I found it on MacScripter.net.
on findLeastItem(lst)
tell application "iCal"
set theLeast to start date of item 1 of lst
set theIndex to 1
set iterater to 1
repeat with i in lst
if start date of i ≤ theLeast then
set theLeast to start date of i
set theIndex to iterater
end if
set iterater to iterater + 1
end repeat


Check out the whole script at the link I provided. It tells the whole story.

c
On Apr 16, 2015, at 12:48 AM, Jan Erik Moström <email@hidden> wrote:

I haven't been writing applescript for several years so I've forgotten almost everything. However, I'm now trying to cobble together an applescript that reads today's events from the Calendar, I then going to create a simple text note from this.

My problem is that I want to entries sorted by time so that the first event of the day is always first etc.

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?
_______________________________________________

 _______________________________________________
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

References: 
 >Sorting list of calendar events (From: Jan Erik Moström <email@hidden>)

  • Prev by Date: Re: Sorting list of calendar events
  • Next by Date: sqlite question
  • Previous by thread: Re: Sorting list of calendar events
  • Next by thread: sqlite question
  • Index(es):
    • Date
    • Thread