You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Screenshot filename in Lion

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

Posted on Jul 26, 2011 12:04 PM

Reply
Question marked as Top-ranking reply

Posted on Jul 26, 2011 6:40 PM

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.

3 replies
Question marked as Top-ranking reply

Jul 26, 2011 6:40 PM in response to jallakim

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.

Sep 14, 2011 10:56 AM in response to jallakim

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.

Screenshot filename in Lion

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.