Tell window to set position to {0,0] changed in Yosemite?

This is a correctly-asked version of a question that I asked with incorrect information a few days ago:

Some time ago, I wrote a script that expands a window to the same size as the display, sets the “Application UI Presentation Mode” to 4 to hide the menu bar and dock, and tells the window to move to position {0,0}.

tell application "System Events"
				repeat until (process "MyApp" exists)
					delay 0.1
				end repeat
				tell process "Myapp"
					repeat until window 1 exists
						delay 0.1
					end repeat
				end tell
				delay 0.7
				tell process "MyApp"
					tell window 1
						set position to {0, 0}
					end tell
				end tell
			end tell

Of course this requires that GUI scripting be enabled - and I have enabled it in Yosemite for this script application. This script has worked perfectly in Snow Leopard, Lion, Mountain Lion, and Mavericks (with minor tweaks for each new OS version).

Under Yosemite, the command to set position to {0, 0} actually sets it to position {0, 22} or something similar - below the position of the menu bar- even though the menu bar is not visible. Instead, the desktop background is visible in a band 21 pixels high, all across the screen.

Is it possible in Yosemite to move a window to position {0. 0} as it was before?

Hi emendelson,

It sounds to me, just guessing that it’s using the frame instead of visible frame (or vice versa). Can’t you use -22 or -21 instead?

Edited: what I was thinking also is that maybe it cannot use -22, but needs -21 maybe. :slight_smile:

Edited: just guessing.


Thanks for the suggestion, but it doesn’t seem to work. And you can’t drag the window by hand into the menubar region either. I think this may not work at all in Yosemite.