Skip to content

Instantly share code, notes, and snippets.

@chrisdavidmiles
Last active January 19, 2022 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisdavidmiles/1b786c4ea62e1883ba31117ca357a838 to your computer and use it in GitHub Desktop.
Save chrisdavidmiles/1b786c4ea62e1883ba31117ca357a838 to your computer and use it in GitHub Desktop.
A utility for resizing windows from the command line on OSX.
#!/usr/bin/env bash
#
# 720p
# A utility for resizing windows from the command line on OSX.
# Taken from: https://lostechies.com/derickbailey/2012/09/08/screencasting-tip-resize-your-app-to-720p-1280x720-in-osx/
# Archived copy: https://archive.is/5kr9m
# Archived code: https://gist.github.com/chrisdavidmiles/1b786c4ea62e1883ba31117ca357a838
#
echo "Setting $1 bounds to 720p"
# 720p is 1280x720.
# Bounds is startX, startY, endX, endY. Adjust size from starting position to account for this
osascript -e "tell application \"$1\" to set the bounds of the first window to {250, 220, 1530, 940}"
# activate the app, to bring it to the front
osascript -e "tell application \"$1\" to activate"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment