• 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: iCal Hide/Show Calendar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iCal Hide/Show Calendar


  • Subject: Re: iCal Hide/Show Calendar
  • From: Axel Luttgens <email@hidden>
  • Date: Fri, 9 Jul 2010 10:09:03 +0200

Le 9 juil. 2010 à 01:50:56, Gil Dawson a écrit :

> Is there a way for an AppleScript program to hide/show a particular calendar in iCal V4.0.3 (Snow Leopard 10.6.4)?
>
> There's a checkbox right next to the name of the calendar that does exactly what I want -- with the mouse.  I'd like to control that checkbox from an AppleScript program.
>
> The iCal dictionary for a calendar doesn't seem to have a property corresponding to that checkbox:
>
> calendar n : This class represents a calendar.
> [...]
>
> The UI Element Inspector identifies that particular checkbox as follows:
>
> <AXApplication: “iCal”>
> <AXWindow: “iCal”>
>  <AXScrollArea>
>   <AXOutline>
>    <AXRow>
>     <AXCheckBox: “”>
> [...]
>
> Is there perhaps a way to translate this information into, say, a System Events command?

Hello Gil,

Indeed, iCal's dictionary doesn't seem to supply the needed functionality.
Feature request? ;-)

Wrt UI scripting, this one works here:

	tell application "System Events"
		tell application process "iCal"
			tell front window
				-- Don't know whether this always is the third scroll area.
				-- If yes, just tell scroll area 3 and avoid localization.
				tell first item of (scroll areas whose description of first outline is "Liste des calendriers")
					tell outline 1
						-- If calendar names are not unique,
						-- one would need to be somewhat
						-- more subtle. ;-)
						tell first item of (rows whose value of text field 1 is "Personnel")
							click checkbox 1
						end tell
					end tell
				end tell
			end tell
		end tell
	end tell


HTH,
Axel

 _______________________________________________
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

  • Follow-Ups:
    • Re: iCal Hide/Show Calendar
      • From: Gil Dawson <email@hidden>
References: 
 >iCal Hide/Show Calendar (From: Gil Dawson <email@hidden>)

  • Prev by Date: Re: Odd date string
  • Next by Date: Re: Odd date string
  • Previous by thread: iCal Hide/Show Calendar
  • Next by thread: Re: iCal Hide/Show Calendar
  • Index(es):
    • Date
    • Thread