Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Total script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Total script
Authored by: paulrob on Feb 11, '04 04:05:03PM
Here's the complete script. Any more queries will have to wait cos this side of the Pond it's raining, it's cold - and the pubs are open.

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 callist to my get_cal_titles() (*get cal titles*)
		set selectedcals to (choose from list callist) as Unicode text (*do menu with cal titles*)
		set thecal to first calendar whose title is selectedcals (*identify selected cal in iCal*)
		set theItem to (make new todo at end of todos of thecal)
		set summary of theItem to "Meet with " & name
		set url of theItem to "addressbook://" & id
		activate
		show theItem
	end tell
end scheduleMeeting

on get_cal_titles() (*gets a list of strings of calendar titles*)
	set list_of_cals to {}
	tell application "iCal"
		repeat with aCal in calendars
			set list_of_cals to list_of_cals & (title of aCal as string)
		end repeat
	end tell
	return list_of_cals
end get_cal_titles


[ Reply to This | # ]