Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 27 lines (21 sloc) 0.792 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
-- AUTHOR: Yehuda Katz
-- MODIFIED: Geoffrey Grosenbach http://peepcode.com
-- DESCRIPTION: Size a window and put it at the top 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 "System Events"
tell process myFrontMost
set position of window 1 to {0, menuBarHeight}
set size of window 1 to {windowWidth, (windowHeight - menuBarHeight)}
end tell
end tell
Something went wrong with that request. Please try again.