Combo / Pupup boxes

I read all the documentation and I can’t find what’s wrong. I’m using NSPopUpButton


tell application "iCal" to set CalNames to name of every calendar as list
	tell popup button "chooseCalendar" of box "prefsBox" of window "prefsWindow"
		--delete every menu item of menu
		repeat with itemName in CalNames
			make new menu item at the end of menu items with properties {name:itemName, title:itemName, enabled:true}
		end repeat
	end tell

worked perfectly. Thanks you!