Dual screen : moving the menubar

Hello

I have 2 screens, and sometimes I use one, sometimes the other. I made a script to move all offscreen windows to the current screen, but I miss the menu bar.

How can I move the osx menu bar to the second screen with applescript ?

Guylhem

Model: MacMini
Browser: Safari 531.22.7
Operating System: Mac OS X (10.6)

I can’t imagine how its possible; you have to drag it from one to the other in in the pref pane gui, and in ~/Library/Preferences/ByHost/ there is a com.apple.preference.displays.xxxxxxxxx.plist file that doesn’t have which screen the menu is in in clear text.

Well, I have this for you:

set thelist to (list folder ((path to home folder as string) & "Library:Preferences:ByHost:" as string))
repeat with i in thelist
	if i starts with "com.apple.preference.displays." then return (i as string)
end repeat

I wish I’d seen this eariler. You can use the Unix utility fb-rotate to move the menu bar to a different display. Find the utility here:

http://modbookish.lefora.com/2010/06/29/a-unix-utility-to-change-the-primary-display-on-os

Using “do shell script…” in conjunction with fb-rotate, should allow your AppleScript to move the menu bar. You can find examples of such scripts at

http://modbookish.lefora.com/2010/04/29/an-applescript-for-switching-displays/#post1