Thursday, May 11, 2017

Setting Application Dimensions in Mac for Screencasting

#!/usr/bin/env bash

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" 

Gist 

sudo chmod +x ./dimension.sh

dimension Terminal
dimension Chrome
dimension Safari
dimension Textmate

These commands automatically resizes the application dimensions with very minimal effort for screencasting. This script is stolen  from Screencasting Tip: Resize Your App To 720p (1280×720) In OSX.