When clicked on a toolbar item, change window ?

Hi, sorry to annoy you folks again but this is a question I haven’t seen completely answered so here it is,

I have a application (almost identical to the example “Simple Toolbar”) but what I want to do is, I want to make a preferences panel/window (I prefer window) which has a toolbar and once you clicked on one of the (three) toolbar buttons, it changes the window to something else.

So I opened the Safari preferences window nib and the preferences window is build out of multiple nibs, each with a different window inside. In Adium it’s different nibs with different NSViews inside of them…

What do you guys think ? If you don’t know what I mean, you can click on Safari its preferences window and see the toolbar.

I already read :
[i]http://macscripter.net/viewtopic.php?id=27228[/i] (which explains a bit, but still not how to change between windows)
[i]http://macscripter.net/viewtopic.php?id=27428[/i] (which is probably the most useful post of the two, it explains more)

Model: PowerBook G4 1.5 GHz
AppleScript: Latest ?
Browser: Safari 528.16
Operating System: Mac OS X (10.5)

Hi James!

Open Interface Builder and create a tab view, make as much tabs as you want and be sure to give them names. Put in your stuff. And then give the tab window itself a name and change “Top Tabs” to “Tabless” now in your AppleScript code do something like this :

on clicked toolbar item theObject
	if identifier of theObject is "Name of Identifier" then
tell tab view "tabview" of window "window"
			set the current tab view item to tab view item "Name of Tab"
		end tell
		tell window "window"
			set title to "Choose a title"
		end tell
end clicked toolbar item