Why do you need to explicitly cast NSInteger?

This doesn’t work as expected:


		if aCheckbox's state is 1 then
			display alert "checked"
		else
			display alert "not checked"
		end if

But this does:


		if aCheckbox's state as integer is 1 then
			display alert "checked"
		else
			display alert "not checked"
		end if

Why the need to cast NSInteger?

And on a related note, what is the correct way to use the NSCellStateValue enum instead of hardcoded values?

All results are returned as some kind of pointer class; you have to coerce them always.

I haven’t had any luck with enums; I suspect they’re not working at this stage. The fact that NSTerminateNow doesn’t work in the default template probably supports this theory.

Thanks for the answers.