Re: selecting a calendar in iCal on Lion? [ to export selected calendars to an ICS file ]
Re: selecting a calendar in iCal on Lion? [ to export selected calendars to an ICS file ]
- Subject: Re: selecting a calendar in iCal on Lion? [ to export selected calendars to an ICS file ]
- From: Nathan Bailey <email@hidden>
- Date: Mon, 10 Sep 2012 16:10:17 +1000
Brilliant! Thanks Axel, that works great - I can now export the
calendars and use them for reports/analysis :-)
kind regards,
Nathan
PS: Script in full below.
set myNames to {"Work A", "Work B"}
repeat with myName in myNames
-- activate calendar myName
tell application "System Events"
tell process "iCal"
tell window 1
tell tool bar 1
tell button 1
click
tell pop over 1
tell scroll area 1
tell outline 1
tell (first row where (value of text field 1 is myName))
select
end tell
end tell
end tell
end tell
click
end tell
end tell
end tell
click menu item "Export…" of menu "Export" of menu item "Export" of
menu "File" of menu bar item "File" of menu bar 1
click button "Export" of sheet 1 of window 1
end tell
end tell
end repeat
On 10 September 2012 01:29, Axel Luttgens <email@hidden> wrote:
> Le 9 sept. 2012 à 09:12, Nathan Bailey a écrit :
>
>> [...]
>>
>> I can't work out how to graphically address the "[Calendars]"
>> button/list in the toolbar to manually select the calendar I want
>> (automator mentions the toolbar but this doesn't seem addressable in
>> AS?)
>>
>> How can I select a calendar in iCal on Lion?
>
> Hello Nathan,
>
> Please find hereafter a skeleton of how this could be achieved through UI scripting.
> As usual, this is terribly fragile; for example, the targeted calendar must not be hidden in the calendar list.
>
> HTH,
> Axel
>
>
> set CalName to "Work A"
> tell application "System Events"
> tell application process "iCal"
> tell window 1
> tell tool bar 1
> tell button 1
> click
> tell pop over 1
> tell scroll area 1
> tell outline 1
> tell (first row where (value of text field 1 is CalName))
> select
> end tell
> end tell
> end tell
> end tell
> click
> end tell
> end tell
> end tell
> end tell
> end tell
>
>
>
> _______________________________________________
> 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
_______________________________________________
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