AppleScript:
My camera puts out files that all start with "DSC_", yours probably uses a different prefix, so you may have to change the line " if nam starts with "DSC_" or nam starts with "IMG_" then"...
Code:
(*
BP 3/12 PhotoDatePrepender
Prepends date to any file in chosen folder that starts with DSC_
(doing this as a folder action misses some, so I'll make it a script app)
--03 02 12 13 41 01 --"Friday, March 2, 2012 1:41:01 PM" (day name is left out)
*)
--set srcfld to ((path to desktop) as text) & "untitled folder"
set srcfld to (choose folder) as string
--return srcfld
try
with timeout of 600 seconds
tell application "Finder"
set props to properties of every file of folder srcfld
end tell
end timeout
on error num
--say "proot"
display dialog num
beep {}
return
end try
set numfiles to count of props
set n to 1
repeat with n from 1 to numfiles
set nam to name of item n of props
set dat to creation date of item n of props
if nam starts with "DSC_" or nam starts with "IMG_" then
set newnam to characters 4 thru -1 of nam -- strip the DSC
set timestr to ""
set m to month of dat as integer
set timestr to addtotimestring(m, timestr)
set m to day of dat as integer
set timestr to addtotimestring(m, timestr)
set m to (year of dat as integer) - 2000
set timestr to addtotimestring(m, timestr)
set m to hours of dat as integer
set timestr to addtotimestring(m, timestr)
set m to minutes of dat as integer
set timestr to addtotimestring(m, timestr)
set m to seconds of dat as integer
set timestr to addtotimestring(m, timestr) --day month year hour min sec (24 hour time)
set newnam to timestr & newnam
try
tell application "Finder"
--set name of file (srcfld & ":" & nam) to newnam
set name of file (srcfld & nam) to newnam
end tell
on error
say "doop"
end try
end if
end repeat
on addtotimestring(m, timestr)
if m is less than 10 then
set timestr to timestr & "0" & m as text
else
set timestr to timestr & m as text
end if
return timestr
end addtotimestring
I saved this as an App from AppleScript Editor. It works as a plain Scropt too, or you could port it to Automator.
It puts up a dialog asking which folder you want it to work on.
It's nothing fancy, so you'll just see a beachball until it finishes. Usually it's pretty quick about it, but if you've got 700 pix that it decides to add a date to, it can take a while. Since 10.5, Finder has gotten progressively slower at displaying changed file names. Apple made the Finder update call asynchronous, so as to better deal with slow network devices. I suppose that's a good thing, if you have a slow network.