Schedule iCal meetings from Address Book

Feb 11, '04 09:55:00AM

Contributed by: cjackson@class.c

Based on a previous hint about adding the ability to schedule calls in iCal through the Address Book, I modified the script to let you schedule meetings the same way. This hint only works on Panther. First, highlight the script below, and click Safari -> Services -> Script Editor -> Make New AppleScript. Give the script a name, and save it in ~/Library -> Address Book Plug-Ins.

Relaunch the Address Book, and when you click on a contact's address, you should be able to schedule the meeting.


using terms from application "Address Book"
  on action property
    return "address"
  end action property
   
  on action title for p with e
    set theName to (first name of p) & " " & (last name of p)
    return "Schedule meeting with " & theName
  end action title
      
  on should enable action for p with e
    return true
  end should enable action
      
  on perform action for p with e
    set theName to (first name of p) & " " & (last name of p)
    scheduleMeeting((id of p), theName)
  end perform action
    
end using terms from

on scheduleMeeting(id, name)
  tell application "iCal"
    set theItem to (make new todo at end of todo of calendar 1)
    set summary of theItem to "Meet with " & name
    set url of theItem to "addressbook://" & id
    activate
    show theItem
  end tell
end scheduleMeeting
Now if I can just figure out how to make it allow you to choose which calendar to use...

Comments (29)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040204213328956