Here's what I'd like to have : a script that tells iCal to print the current week with a few formatting options (no mini-calendar, no calendar keys).
I'm not familiar at all with Apple Script but it seems I have no other choice since Automator cannot do anything to help me. So I found this :
tell application "iCal"
activate
set frontmost to true
end tell
tell application "System Events"
tell process "iCal"
tell menu bar 1
tell menu bar item "File"
tell menu "File"
click menu item "Print…"
end tell
end tell
end tell
delay 1
tell window "Print"
click pop up button 1
click menu item "Week" of menu 1 of pop up button 2
delay 1
click pop up button 4
click menu item "Today" of menu 1 of pop up button 4
delay 1
click button "Continue"
end tell
tell window "Print"
keystroke return
end tell
end tell
end tell
Problems are :
- "click menu item Week" gives me an index error, I don't know why.
- I can't control the formatting options with this but I have no idea how to make sure iCal doesn't check the "calendar keys" and "mini-calendars" boxes.
- iCal has to come frontmost and I'd better have it do the job in the background. I'm not sure this is doable, though.
So if anybody can tell me how to improve this and solve the "week" and options issues...
Thanks a lot