How to get OS X screenshots with no spaces in filenames

In design, they say space lets layouts breathe. Well, in filenames, it makes me choke on that Apple.

If you can’t hang with the filenames that Mac OS X 10.6 (Snow Leopard) and 10.7 (Lion) generate when you do screen captures, here’s the multi-step process to turn the unfashionable “Screen shot 2011-07-05 at 5.38.53 AM.png” into a humble but stylish “screenshot_2011-07-05_05.38.53.png“.

  1. Change the date format to 24 hours, if applicable, by customizing the Medium times format under System Preferences > Languages & Text > Formats > Times > Customize > Medium. 1
  2. Run:1
    defaults write com.apple.screencapture name "screenshot"
  3. Edit the appropriate localization file as root (change English to your language):2
    sudo vi /System/Library/CoreServices/SystemUIServer.app/Contents/Resources/English.lproj/Localizable.strings

    comment out the old filename template and replace with a new one:3
    /* Format screencapture file names */
    /* "%@ %@ at %@" = "%1$@ %2$@ at %3$@"; */
    "%@ %@ at %@" = "%1$@_%2$@_%3$@";
  4. Restart the SystemUIServer:
    killall SystemUIServer

Footnotes:

  1. Source: everydaymacsupport.com [] []
  2. Source: macworld.com []
  3. I tried "screenshot_%2$@_%3$@" but that didn’t work []
This entry was posted in OS X and tagged , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
  • Guest

    this file is now binary:
    /System/Library/CoreServices/SystemUIServer.app/Contents/Resources/English.lproj/Localizable.strings

    and doesn’t contain the “/* Format screencapture file names */” setting

  • Guest

    sudo plutil -convert xml1 ScreenCapture.strings

  • Slaughts

    i used the code below to turn off the date but i still get name then space then count ie “screenshot 1.jpg” be great to have no space in the name

    defaults write com.apple.screencapture include-date -bool false
    killall SystemUIServer