Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (24 sloc) 0.964 kB
-- AUTHOR: Yehuda Katz
-- MODIFIED: Geoffrey Grosenbach http://peepcode.com
-- DESCRIPTION: Size a window and put it at the top center of the screen
-- so it can be screencaptured along with the menu.
set windowWidth to 1000
set windowHeight to 600
set menuBarHeight to 20
delay 0.1
set AppleScript's text item delimiters to ""
tell application "Finder"
set {screen_top, screen_left, screen_width, screen_height} to bounds of window of desktop
end tell
tell application "System Events"
set myFrontMost to name of first item of (processes whose frontmost is true)
end tell
tell application "Finder"
set {desktopTop, desktopLeft, desktopRight, desktopBottom} to bounds of desktop
end tell
tell application "System Events"
tell process myFrontMost
set position of window 1 to {((screen_width - windowWidth) / 2), menuBarHeight}
set size of window 1 to {windowWidth, (windowHeight - menuBarHeight)}
end tell
end tell
Jump to Line
Something went wrong with that request. Please try again.