Guest User

Untitled

a guest
Mar 23rd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. (* This AppleScript will resize the current application window to the height specified below and center it in the screen. Compiled with code from Natanial Wools and Amit Agarwal *)
  2.  
  3. set the_application to (path to frontmost application as Unicode text)
  4. set appHeight to 1440
  5. set appWidth to 900
  6.  
  7. tell application "Finder"
  8. set screenResolution to bounds of window of desktop
  9. end tell
  10.  
  11. set screenWidth to item 3 of screenResolution
  12. set screenHeight to item 4 of screenResolution
  13.  
  14. tell application the_application
  15. activate
  16. reopen
  17. set yAxis to (screenHeight - appHeight) / 2 as integer
  18. set xAxis to (screenWidth - appWidth) / 2 as integer
  19. set the bounds of the first window to {xAxis, yAxis, appWidth + xAxis, appHeight + yAxis}
  20. end tell
Add Comment
Please, Sign In to add comment