Chrome/is bookmarks bar visible?

Is there any way that I could get Chrome to tell my script if the bookmarks bar is currently visible or not? I have several GUI scripts that click through log-ins and navigate sites to where I commonly need to be. The locations for clicks are based on the location with the bookmarks bar visible. But if the bookmarks bar is not visible, the click will not hit the button. It will tell me if it is presentation mode, but I don’t see it for bookmarks bar. Any help is appreciated!

this little script should do the job:

activate application "Google Chrome"
tell application "System Events"
	tell process "Google Chrome"
		set bool to false
			if (value of attribute "AXMenuItemMarkChar" of menu item 1 of menu 1 of menu bar item 5 of menu bar 1) is "✓" then set bool to true
		end try
	end tell
end tell

The bool variable will return you whether the bookmarks bar is currently visible or not.

But I think it’s not so clever to click on the buttons based on an {x,y} position. I would do this with a simple do javascript command or with UI scripting. If you want to use UI scripting, the “UI Browser” from PFiddlesoft is your best mate :). If you want to use javascript than use the “inspect element” function from chrome.

I hope this helped you out.