Hide Toolbar

This must be something very simple, ut I spent quite some time trying different things:
I added a Toolbar to my app, by simply copying the scripts from the Simple Toolbar example that comes with the developer kit. Works fine.
But, I want the toolbar to be hidden when the app opens.

set the toolbar visible of theObject to false

is something that I found on the 'net, but it gives an error.
Anyone around here who knows how to tackle this?

Model: MacBook Pro
AppleScript: 1.10.7
Browser: Firefox 2.0.0.3
Operating System: Mac OS X (10.4)

Try:

set visible of (toolbar of window "myWindow") to false

j

Unfortunately, that’s not working either. I get this “can’t make visible of toolbar of window “Main” into type reference” error. Note that the brackets you suggested internally have been ignored by Applescript.
Any other suggestions?

Where are you executing the code? Make sure that you are executing it AFTER the toolbar has been created and assigned to the window, otherwise the toolbar technically won’t exist yet.