If you’ve taken screenshots of windows in Tiger and Leopard using the command-shift-4+space trick, you’ll have noticed that Leopard will include the window’s (rather large) drop shadows in the resulting image. Depending on your point of view this can be good, bad, or a mixed blessing. I’m in the latter camp. They can be nice for blog posts, but if you’re creating documentation, for example, they can take up precious space on the page.
Using this hint as a starting point, I wrote the following bash script to make the process of disabling and enabling those shadows quick and painless:
#!/bin/bash
usage ()
{
/bin/echo "Usage: shotshadows [off|on]"
exit 1
}
if [ $# == 1 ]; then
if [ $1 == "off" ]; then
/bin/echo "Disabling drop shadows in screenshots and restarting SystemUIServer"
/usr/bin/defaults write com.apple.screencapture disable-shadow -bool true
/usr/bin/killall SystemUIServer
elif [ $1 == "on" ]; then
/bin/echo "Enabling drop shadows in screenshots and restarting SystemUIServer"
/usr/bin/defaults delete com.apple.screencapture disable-shadow
/usr/bin/killall SystemUIServer
else
usage
fi
else
usage
fi
Save this script as shotshadows — or download it here — make it executable, and drop it somewhere in your path. (I use /usr/local/bin.) Now you can turn screenshot shadows on and off with the simple terminal commands shotshadows on and shotshadows off. The change takes effect instantly.
Follow me on twitter
February 13, 2009 at 9:38 am
…make it executable… How?
February 13, 2009 at 9:44 am
Open the Terminal, type ‘chmod u+x ‘ (with the space after x), then drag and drop the script into the Terminal window, then hit enter.