• 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: more scripting iCal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: more scripting iCal


  • Subject: Re: more scripting iCal
  • From: David Glass <email@hidden>
  • Date: Wed, 27 Oct 2004 11:24:04 -0700

On Oct 22, 2004, at 16:53, Paul Berkowitz wrote:

which is the 'summary' property. Unfortunately, you can't set or get the
note ('description' property in event) - it's not scriptable for todos.
Another half-assed iCal AppleScript implementation.

I don't know if anybody has come up with a solution for this limitation, but I arrived at this:


on fncReadCalendarFile(strUID, alsCurrentCalendar)
-- '-A 4' returns the four lines following the line that matched
set strScript to "grep -A 4 " & strUID & " " & (POSIX path of alsCurrentCalendar)
set strMatchingText to do shell script strScript

set strDescription to paragraph -1 of strMatchingText
if strDescription contains "DESCRIPTION:" then
set strDescription to (characters 13 thru (length of strDescription) of strDescription) as string
else
set strDescription to "-NONE-"
end if


return strDescription
end fncReadCalendarFile

Coming into this handler is the UID of a To Do, and the path to the actual iCal file for the calendar (.ics file)

In my (currently brief) testing this works well, and is speedy, but I don't have much in iCal, so no guesses as to how it will perform with a well-populated calendar. I imagine it could be optimized some as well.

--
David Glass - email@hidden
Gray Matter Computing
559-303-4915

Apple Certified Help Desk Specialist

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: more scripting iCal (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Setting the default signature in Entourage
  • Next by Date: Re: Code Completion suggestion
  • Previous by thread: Re: more scripting iCal
  • Next by thread: Re: more scripting iCal
  • Index(es):
    • Date
    • Thread