The Pug Automatic

Share screenshot to big screen

Written May 25, 2008. Tagged OS X, AppleScript, Shell scripting.

I often want to show something on my screen to my girlfriend.

The simple solution is to call her over or use the fancy OS X zooming.

The silly Saturday night hack version is this:

Make a shell script that

  1. requests an interactive screen capture (mouse selection, or press space to capture an entire window),
  2. sends the picture over scp to a computer connected to a big-screen tv, and
  3. makes the latter computer show the picture full screen for a few seconds.

I've tied the script (saved as ~/Library/Scripts/Share Screenshot.sh) to ⇧⌥⌘4 using Quicksilver and its Terminal Module plug-in.

In the code, modify the scp and ssh destination and the viewing duration (the delay 8 (seconds) bit) to taste.

The scp/sshing adds some overhead, so there is a delay of a few seconds between taking the screenshot and seeing it on the big screen.

The full-screen display uses Quick Look. There is a command-line interface to Quick Look, but it's fairly limited, so full-screen is achieved by some AppleScript to open the Finder and trigger ⌥⌘Y with the file selected. For this to work, I believe "Enable access for assistive devices" must be checked under the Universal Access preference pane. Not sure whether it is by default.

The AppleScript code with nicer formatting is available here.