MacWorld Conference website…Ouch. Blogging from iPhone
Feb 20

man screencapEver since upgrading to Leopard, I was surprised to find that screen captures of windows now include a drop shadow. If you’re not familiar with OS X’s built-in screencap utility, you can hit cmd-shift-3 to grab the full screen, cmd-shft-4 to get selection crosshairs, and if you use cmd-shift-4 then hit the spacebar, you’ll be able to grab any screen elements (windows, menus, etc.). In Tiger, the latter method would grab just the window, and in Leopard, it grabs the window plus its drop shadow. I found this extremely annoying, because I often need to put together instruction sheets for users, and I found I was always having to crop-out the shadow.

Since Leopard was released, I would occasionally google to try to find a solution to this problem, but have never been able to find a fix. Until today, when I had an epiphany. OS X has a command line screen capture tool. “Perhaps I’ll find a clue there,” I thought. Sure enough - pay dirt. Look what I found in the man page…

-o In window capture mode, do not capture the shadow of the window.

That right there tells me that it’s an option, and that there’s at least a workaround. So I coupled this with two other options, interactive mode, and clipboard (rather than save) and voila! It works!

screencapture -ioc

Using the command above, I was immediately presented with Leopard’s screen cap crosshairs, so I then hit the spacebar to switch to element selection mode, moused over the window I wanted to grab, then clicked. This then put the image in my clipboard, so I switched to Preview.app, and opened a new document, which automatically inserts the contents of the clipboard. Without the useless drop shadow.

This is definitely a workaround for now. I’m hoping there’s a preference file somewhere that can be modified to omit the drop shadow from screen caps by default. Until then, I just wrapped the command above in some AppleScript for ease of use:

do shell script “screencapture -ioc”

Saved as an AppleScript app works great because you can invoke it by name via Spotlight.

Have fun, and let me know if you figure out where this default preference resides.

Leave a Reply