Safari.app: Controlling its window bounds example


tell application "Safari"
	if (exists of document 1) is false then make new document
	set screenAvailableWidth to (do JavaScript "screen.availWidth" in document 1)
	set screenAvailableHeight to (do JavaScript "screen.availHeight" in document 1)
	set screenWidth to (do JavaScript "screen.width" in document 1)
	set screenHeight to (do JavaScript "screen.height" in document 1)
	set dockWidth to screenWidth - screenAvailableWidth
	set menuBarHeight to screenHeight - screenAvailableHeight
	set bounds of window 1 to {dockWidth + 1, menuBarHeight + 1, screenWidth, screenHeight}
	-- set bounds of window 1 to {dockWidth + 1, menuBarHeight + 1, screenWidth, screenHeight / 2}
end tell

NOTE: JavaScript execution in the Safari settings must be allowed by you.