Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a folder in dropbox for all my screenshots, and redirected all my screenshots there.

However the default screenshots file name are long (it contains a time stamp and I don't see how to remove that). I'm wondering if I can use some shell script or applescript to do this.

Also I need it only change the names of newly added files. I've tried automator, but it keep renaming all files in that folder. E.g. 01.png may become 03.png after adding other files to that folder, which make correct dropbox reference literally impossible.

share|improve this question
Can you give us an example of the file names? (With the date in the name)? – Hennes Jul 26 '12 at 17:56
In principle you can do this using Folder Actions and AppleScript, but those don't work reliably if there are several files changed in quick succession. – Daniel Beck Jul 26 '12 at 17:57
@Hennes e.g. "Screenshot 2012-07-26 上午10.40.25" It contains Chinese character. – h__ Jul 26 '12 at 18:33
I can't seem to figure it out. I was toying with something like this from a shell for a in * ; do echo -n "Moving" $a "to " ; (echo $a | cut -c1-10,25-26,28-29,31-32) ; done (Obviously a literal cut and paste just echos text rather than execute a mv) – Hennes Jul 26 '12 at 20:01

Here's a simple bash script you can use:


# Rename a folder of images using a prefix in a numbered sequence
# @author Henry Tseng
# Jul 27, 2012

# Retrieve 
if [ ! -d "$1" ]
    echo "rename_files: \"$1\" is not a directory"

# Rename set
echo "Renaming"


for f in $FILES
    N=`expr $N + 1`
    echo " $f"
    RCMD="mv '$f' $1img_$N.jpg" 
    eval $RCMD
share|improve this answer

You can do this using the commercial Hazel tool.

Just create a rule that looks like the following:

Screenshot of applicable rule

The result will look like this, with numbers appended due to rename automatically selected in Options:

Folder containing sequentially named image files

share|improve this answer
Great! Is it possible to do it using Quicksilver? – h__ Jul 26 '12 at 18:35
@hyh Hazel and Quicksilver are fundamentally different tools. That's like asking how to do something in Firefox when the answer talks about Microsoft Word. Just download Hazel and see for yourself how it works. – Daniel Beck Jul 26 '12 at 18:47
so Hazel is an app just for organizing folders? Then $25 seems expensive. I'd like to find some hack to do this by myself. – h__ Jul 27 '12 at 1:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .