applescript

Resizing macOS app windows for 16:9 screen capture

I frequently need to capture a window of some Mac app for a recording (usually for my YouTube channel), and I've used a little AppleScript I wrote years ago for the purpose.

Somehow, that script (which I saved as a 'one shot' App (.app extension) that just runs then quits) got deleted off my Script Editor folder in my iCloud Drive, so I had to re-create it.

Luckily, the syntax for this operation is dead simple:

tell application "Safari"
    set bounds of front window to {0, 50, 1280, 770}
end tell

You can adjust the {X, Y, width, height} parameters accordingly—note that the width and height seem to be additive to the X/Y. So I use 770 instead of 720 for the height (720 + 50).

In Script Editor, save the file as a .app, with the option to keep it running unchecked. Now, whenever you want a window sized perfectly for capture, just press Command + Spacebar, then type in the name of the Script/App you saved, and hit enter. The top-most window in Safari will scale to exactly 720p resolution.

Shaving Hours off my Workflow - Trimming silence with FCPX and AppleScript

Final Cut Pro X - Automatically trimmed silence cuts

For the past few years, my workflow for editing videos for my YouTube channel was the following:

  1. Write and record narration / 'A-roll' using a teleprompter
  2. Import recording into timeline, and chop out silent portions manually using the blade and/or range tools
  3. Work on the rest of the edit (adding 'B-roll' and inserts).

Step 3 is where the vast majority of editing time is spent, especially when I need to add in charts, motion graphics, etc.

Making a Terminal window the right aspect ratio for streaming or recording

Recently I've been spending a bit of time producing video content of both browser windows and Terminal windows for screen recordings and livestreams on my YouTube channel.

One common issue I have to deal with is trying to optimize the aspect ratio of the window for the video dimensions. In 99% of all cases, I need the window to be 16:9. And ideally, I want the window to be recorded at 1280x720 at 2x 'retina' resolution, so when I capture the window, it will be nice and sharp at 1080p, which is my typical output resolution.

In the past, I'd open up a 1280x720 image at 2x resolution, then drag the Terminal window over it. However, getting that to be pixel perfect is sometimes frustrating, and it's always annoying since it takes me an extra 10-20 seconds per recording.

In my searching, I found this handy article from way back in 2013: How to Resize Windows on your Mac to Specific Sizes.