Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Help me create a script to have iCal print a weekly schedule

Help me create a script to have iCal print a weekly schedule
Thread Tools
Forum Regular
Join Date: Feb 2005
Location: Paris, Fr
Status: Offline
Reply With Quote
Apr 5, 2008, 09:33 AM
 
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
(Last edited by kilechki; Apr 5, 2008 at 09:36 AM. (Reason:formatting))
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:15 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2