Screencasting Tip: Resize Your App To 720p (1280×720) In OSX

I record my screencasts in 720p resolution. Up until recently, I had been changing my monitor’s resolution to 1280×720 in order to do the recording. The problem with this is that I ended up having to edit out the system bar at the top of OSX. This reduced the height of my screen recordings by about 20 pixels. When stretched to fit, things got a bit blurry.

To fix this problem, I’ve stopped changing my monitor resolution. Instead, I set the size of the windows for the applications that I am going to record. I looked around for some simple ways to do this and came across a few window management apps that may have made it easy. But I already use SizeUp and I really like it, so I didn’t want to switch to something else. Instead, I whipped up a little bash script that uses Apple’s “osascript” tool to do the window resizing for me.

Copy this gist in to the file `/usr/bin/720p` and then `sudo chmod +x /usr/bin/720p` to  make it executable:

#!/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" 

Now from a terminal window I can run 

$ 720p AppName

where “AppName” is the name of the app to resize. For example:

$ 720p Chrome

Setting Chrome bounds to 720p

$ 720p Terminal

Setting Terminal bounds to 720p

$ 720p MacVim

Setting MacVim bounds to 720p

This will resize the app’s window to 1280×720, somewhere sort of near the center of your monitor (assuming you are running a 1080p monitor).

By using this little script, I can set all of the windows of the apps that I want to record to the correct size. Then when I record the screencast, I can crop the viewable area down to 1280×720 and all of my apps will take up the full screen, providing pixel-perfect clarity on any device that can display 720p (like an iPad for example).

About Derick Bailey

Derick Bailey is an entrepreneur, problem solver (and creator? :P ), software developer, screecaster, writer, blogger, speaker and technology leader in central Texas (north of Austin). He runs - the amazingly awesome podcast audio hosting service that everyone should be using, and where he throws down the JavaScript gauntlets to get you up to speed. He has been a professional software developer since the late 90's, and has been writing code since the late 80's. Find me on twitter: @derickbailey, @mutedsolutions, @backbonejsclass Find me on the web: SignalLeaf, WatchMeCode, Kendo UI blog, MarionetteJS, My Github profile, On Google+.
This entry was posted in AppleScript, OSX, Screencast, WatchMeCode. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • Anonymous

    I do exactly this with a key command in Size-Up. I use the “Center Window” shortcut and set the size to 1280×720.

    • well… i learned something new about size up today :D

      thanks ben!

    • Arka Der Stepanian

      Awesome, thanks!

  • Why can’t you just leave the system bar on the top?

    • it looks bad… it takes up room on the screen for no reason. nobody cares what apps you have open. no one wants to see the system time jump around randomly as you edit, cut copy and paste video segments together, and the space that the title bar takes up would be much better served with useful information from the screencast contents.

      in general, leaving the system bar is very amateur-hour :)

      • I guess it’s a horse a piece. If you keep the entire screen, people can see when you switch apps (if you use your mouse), or use the menu bar, etc. On a Windows machine, you can disable the clock if you’re really worried about it. I’ve personally been annoyed when people don’t show the whole screen because there are times when their mouse leaves the recording area to do things.

        • “I’ve personally been annoyed when people don’t show the whole screen because there are times when their mouse leaves the recording area to do things.” – that’s usually a sign of poor planning and editing. the content being presented should always be in the final output. if you must use the system bar (in windows or osx), then record it. but if you don’t need to use it, don’t show it. :)