deselect toolbar item

is there anyway to deselect a toolbar item. I know how to select one, but how do you deselect one. There’s nothing about it in the documentation.



what is that you want?
Do you want to click on a toolbar and have something happen of just want to select a toolbar.

in the first case:
Use: on clicked toolbar item theObject

In the second case:
When you just click on another toolbar item that item will be selected.

i know all of that. What i have is a toggle button in my toolbar. When it’s clicked it becomes seletected. But when it’s clicked again i want it to be deselected.

You could try adding a invisible item, such as a button, that is told to be selected when the toolbar item is clicked the second time. Perhaps?

but how do i have the toolbar item deselected without the user having to click a different toolbar item?

set selected item identifier of windowToolbar to missing value

that spits this out in the console:

2008-03-05 15:05:47.691 [766:10b] *** -[NSNull isEqualToString:]: unrecognized selector sent to instance 0xa0120008 2008-03-05 15:05:47.739 [766:10b] An exception was thrown during execution of an NSScriptCommand... 2008-03-05 15:05:47.768 [766:10b] *** -[NSNull isEqualToString:]: unrecognized selector sent to instance 0xa0120008

but then this item will appear in the customize menu for the toolbar.