Display age in iCal

Hello,

I’m a total newbie to MacScripter and applescripting, although I have written shell scripts in my past as a Solaris system administrator. I am currently a proud, relatively new owner of an iMac - finally threw the windows box in the closet.

I would like to be able to display, in iCal, the age of everyone in my Birthday calendar.

I found the following script here:

http://hints.macworld.com/article.php?story=20040105125520276

using terms from application "Address Book"
	on action property
		return "birth date"
	end action property
	
	on action title for p with e
		set monthnow to (month of (current date) as number)
		set daynow to (day of (current date) as number)
		set monthcheck to ((month of e) as number)
		set daycheck to ((day of e) as number)
		if monthnow < monthcheck then
			return (first name of p) & " " & ¬
				(((year of (current date)) - (year of e) - 1) ¬
					as string) & " years old"
		else
			if monthnow = monthcheck then
				if daynow < daycheck then
					return (first name of p) & " " & ¬
						(((year of (current date)) - (year of e) - 1) ¬
							as string) & " years old"
				end if
			end if
			return (first name of p) & " " & ¬
				(((year of (current date)) - (year of e)) ¬
					as string) & " years old"
		end if
	end action title
	
	on should enable action for p with e
		return true
	end should enable action
	
end using terms from

It compiles and runs, but nothing happens, either in Address Book or iCal.

I found a post here:

https://discussions.apple.com/thread/2187193?start=0&tstart=0

that says it’s a bug in Address Book and sure enough, when I looked in the Console I found the very same error message.

All of this is fairly old and while the script calculates age, it wasn’t meant to display it in iCal.

I have searched through a lot of the forums here and don’t see anything that does this, although many come close.

Does anyone have any suggestions?

Thanks,
Vicky

AppleScript: 2.1.2
Browser: Safari 6534.50
Operating System: Mac OS X (10.6)

I’m running Lion and birthdays now show the age in iCal.

I’ve got some 3rd party software that isn’t ready to go to Lion yet.

I thought I’d try a different approach, using a shell script to edit the ics files.
Before writing the script, I did a simple test. I used vi to modify the Summary property of one of the birthday events ics file to see if it would display in iCal. It didn’t display.
I inserted a number at the beginning of the property, at the end, in between the person’s name and the word Birthday, in the middle of the word Birthday, in the middle of the person’s name and each time I started iCal and rebooting my machine. Nothing.

Any idea what I’m missing?

Model: iMac
AppleScript: 2.1.2
Browser: Safari 6534.50
Operating System: Mac OS X (10.6)