• 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: Help with AppleScripting iCal and Lion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with AppleScripting iCal and Lion


  • Subject: Re: Help with AppleScripting iCal and Lion
  • From: Nigel Garvey <email@hidden>
  • Date: Sat, 29 Oct 2011 18:21:25 +0100

Tim Cimbura wrote on Thu, 27 Oct 2011 20:51:43 -0500:

>The following script…is failing with Lion. Worked fine under Snow
Leopard.
>Any ideas?
>Any ideas on how to gracefully exit if the calendar doesn't exist?

>tell application "iCal"
>	-- Find the calendar with this name
>	set theCal to ""
>	repeat with i from 1 to count of every calendar
>		if title of (item i of every calendar) is theCalendar then set theCal
to i
>	end repeat

Calendars have had names rather than titles since iCal 2.0. Maybe the
version with Lion no longer supports the use of the 'title' keyword.

  tell application "iCal"
    -- Find the calendar with this name
    if (calendar theCalendar exists) then
      set theCal to calendar theCalendar
    else
      -- Do something if the calendar doesn't exist.
      error number -128 -- Stop the script.
    end if

    -- Rest of code.
  end tell

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

  • Prev by Date: Re: Getting record items of a sublist
  • Next by Date: Re: Getting record items of a sublist
  • Previous by thread: Help with AppleScripting iCal and Lion
  • Next by thread: Fwd: Getting record items of a sublist
  • Index(es):
    • Date
    • Thread