opening and closing drawers

Hi

Im trying to get my head around opening and closing drawers, and would like some help please.

in Xcode I use something like this to open and close drawers:

on clicked theObject
	if name of theObject is "open2" then
		tell window "main"
			set currentState to state of drawer "drawer2"
			tell application "TEST APP"
				set background color of window of content view of drawer "drawer2" of window "main" to {1, 1, 1}
			end tell
			if currentState is equal to drawer closed or currentState is equal to drawer closing then
				tell drawer "drawer" to close drawer --close other drawers
				tell drawer "drawer3" to close drawer
				tell drawer "drawer4" to close drawer
				tell drawer "drawer5" to close drawer
				tell drawer "drawer6" to close drawer
				tell drawer "drawer2" to open drawer on right edge
			else if name of theObject is "open2" then
				set currentState to state of drawer "drawer2"
				if currentState is equal to drawer opened or currentState is equal to drawer opening then
					tell drawer "drawer2" to close drawer
				end if
			end if
		end tell
	end if
end clicked

how using ASOBJC would I go about setting something similar up?, I found this thread which sort of gave me an idea, but couldnt get it to work, any help appreciated, cheers

First off you need to have a separate property for each drawer, set to missing value, that you connect to the relevant drawers in IB. Then you call methods on the appropriate properties. So:

property myDrawer: missing value – connected to drawer in IB

myDrawer’s |open|() – pipes needed because open is a reserved word in AS
myDrawer’s |close|()
myDrawer’s toggle()
if myDrawer’s |state|() = current application’s NSDrawerClosedState then

Keep in mind also that you don’t need to connect all buttons to one handler.

Thanks Shane, ill see how I go, pretty big learning curve with ASOBJC, tones to learn