Automate Print Dialog with AppleScript in Lion - Checkbox Problem
Folks,
I'd like to automate a daily printing of an ical Calendar.
I have the following applescript.
tell application "iCal"
view calendarat (my (current date))
switch viewtoday view
activate
tell application "System Events"
keystroke "p" usingcommand down
delay 1 -- (seconds)
if value of checkbox "Calendar Keys" is not 0 then
click checkbox "Calendar Keys"
end if
end tell
end tell
However, I get the following error:
System Events got an error: Can’t get checkbox "Calendar Keys".
I've used the Accessibility Inspector, and it tells me that the check box is called 'Calendar Keys", so I'm not sure what's going wrong.
Any ideas?
Thanks,
Zvi