Re: Help with AppleScripting iCal and Lion
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