3 Replies Latest reply: Sep 14, 2011 11:59 PM by jallakim
jallakim Level 1 Level 1 (0 points)

Hi,

 

Anyone knows a way to rename the filename of screenshots in Lion?

 

I'm talking about the part that comes after the prefix, that can be changed via;

 

defaults write com.apple.screencapture name NEWPREFIX

 

In Snow Leopard, this was achieved by chaning a line in the following file;

 

/System/Library/CoreServices/SystemUIServer.app/Contents/Resources/English.lproj/Localizable.strings

 

This is no longer possible, as the value isn't present in this file anymore. The .strings-file have also been changed from a plain text file, to a binary plist file since Snow Leopard.

 

The reason I want to change this, is to avoid spaces in the file name. I know that some of you use scripts that goes through the screenshot-folder to rename, but was hoping to avoid this.

 

Anyone knows of a way to change this in Lion?


MacBook Pro, Mac OS X (10.7), Mid-2009, 2.8 GHz, 8GB RAM
  • 1. Re: Screenshot filename in Lion
    jallakim Level 1 Level 1 (0 points)

    So, I've solved this temporarily by using a short bash-script that I run whenever I take a screenshot;

     

    #!/bin/bash
    
    DIR_TO_FIX=~/Pictures/Screendumps
    
    ls -1 $DIR_TO_FIX | while read file; do
       if echo "$file" | grep -qE "^dump[ ]+"; then
          NEW_FILENAME=`echo "$file"|perl -wple 's, at , ,g;s,\s+,_,g'`
          mv -n "$DIR_TO_FIX/$file" "$DIR_TO_FIX/$NEW_FILENAME"
       fi
    done
    

     

    Still hoping to find a proper fix for this, though.

  • 2. Re: Screenshot filename in Lion
    fu-jyh Level 1 Level 1 (10 points)

    Hi,

     

    I did following steps to change default screenshoot filename

    $ sudo su

    # cd /System/Library/CoreServices/SystemUIServer.app/Contents/Resources/English.lpro j

    # plutil -convert xml1 ScreenCapture.strings

    # vi ScreenCapture.strings

    change

    <key>%@ %@ at %@</key>

              <string>%@ %@ at %@</string>

    to

    <key>%@ %@ at %@</key>

              <string>Pictures</string>

    # plutil -convert binary1 ScreenCapture.strings

    # killall SystemUIServer

     

    You can replace "Pictures" to whatever you like.

  • 3. Re: Screenshot filename in Lion
    jallakim Level 1 Level 1 (0 points)

    Genious! Thanks!