Here's an answer for the bonus question.
I actually want to put a photo's
creation date into its filename, to
get something like 20091231 2359 New
Year.jpg. I'm afraid that I need some
non-trivial combination of commands to
achieve that?
Assuming you want to take the photo's creation date from the EXIF data, you'll need a separate tool for that. Luckily it turns out that jhead
offers a trivial way to do exactly what you want, with its -n
option.
$ jhead -h
[...]
-n[format-string]
Rename files according to date. Uses exif date if present, file
date otherwise. If the optional format-string is not supplied,
the format is mmdd-hhmmss. If a format-string is given, it is
is passed to the 'strftime' function for formatting
In addition to strftime format codes:
'%f' as part of the string will include the original file name
[...]
Here's an example:
$ jhead -n%Y-%m-%d-%f New_year.jpg
New_year.jpg --> 2009-12-31-New_year.jpg
Edit: Of course, to do this for a bunch of photos, it'd be something like:
$ for i in *jpg; do jhead -n%Y-%m-%d-%f $i; done
To tweak the date formatting to your liking, take a look at the output of date --help
, for example; it will list the available format codes.
(jhead is widely available for different systems. If you are e.g. on Ubuntu or Debian, simply type sudo apt-get install jhead
to install it.)
Best Answer
It's possible with an AutoHotkey script:
Install AutoHotkey, save the code above in a file with the .ahk extension and launch the script. It will wait for the Rename window to appear. When it does, it automatically "clicks" on the Yes button (identified here with "Button1").
If you don't want to install AutoHotkey, here is a compiled version of the same script. Run the executable and watch it do its magic :-) .
Note it does not really answer the question, as the question still appears. But it's automated so you'll not be bothered by it anymore.