Browse files

Added script to size a window and place it at the top of the screen b…

…y the menu
  • Loading branch information...
1 parent 22294a2 commit a8f8434aaf75c42e697770a8a98d70cdfe6c33e4 @topfunky committed Mar 9, 2009
Showing with 26 additions and 0 deletions.
  1. +26 −0 at-menu.applescript
@@ -0,0 +1,26 @@
+-- AUTHOR: Yehuda Katz
+-- MODIFIED: Geoffrey Grosenbach
+-- 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

0 comments on commit a8f8434

Please sign in to comment.