Photoshop anyone know how to exit the quickmask mode in script?

This works except for the exit quick mask mode.

Anyone else been able to do it?

tell application "Adobe Photoshop CS5"
  activate
          tell front document 
                    if (quick mask mode) then exit quick mask mode
 
          end tell
end tell

For anyone else needing it its actually a channel so therefore you only need to delete a channel

tell application "Adobe Photoshop CS5.1"
	activate
	tell front document
		if (quick mask mode) then delete channel ¬
			"Quick Mask"
	end tell
end tell