Quantcast

mac geeks - looking for an apple automator script

Transcend

My Nuts Are Flat
Apr 18, 2002
18,040
3
Towing the party line.
I am currently looking for a script to take 1dmk2 files and append 2 pieces of info to them.

I want to take the file name and append a shoot/event name as well as the date the photo was taken.

ie: xxx1234.cr2 - SteAnneWC_xxx1234_15062007.cr2

Does anyone know of a script that will do this, or that I can modify to do this? I suck at automator and can't get it to do exactly what I want. The most crucial part is I want the date the photo was taken, and not the date it was copied to the HDD. Worst case i can deal with that, but would prefer not to.
 

sanjuro

Tube Smuggler
Sep 13, 2004
17,373
0
SF
#!/bin/ksh
for i in filename1 filename2 filenameN
do
cp $i $i.cr2
done

Please tell me you can run a ksh shell in OS/X. BTW, you can also substitute this for the second line

cd /directory ; for i in *
 

Transcend

My Nuts Are Flat
Apr 18, 2002
18,040
3
Towing the party line.
Ha, ya I can run a script. But no I won't be.

I have way too many shots to rename, in seperate folders. With a automator script i can have it prompt me for the event name when i drag a selection onto a droplet, and away it goes.
 

Kihaji

Norman Einstein
Jan 18, 2004
398
0
Would you want to manually input the date, or have it automatically figured out?

Oh, and what sort of software do you use to manage/import your images. Iphoto or apperature?
 

Transcend

My Nuts Are Flat
Apr 18, 2002
18,040
3
Towing the party line.
I need the date to be drawn from the EXIF actually, which is what is making it complicated. I use neither for photos. I ingest into Iview media Pro, and then process with C1. Toshi put me onto abetterfinderrenamer last night and I think it may do the work, but i'm still looking for an automator script, as I can have it automatically run on ingest.

Iphoto is utter crap, and aperture is even worse.

Just to be clear here, I push about 25 000 - 30 000 photos a season into a DB. They all need to be renamed so that they have unique file names as the camera cycles back to zero at 9999 shots.
 

sanjuro

Tube Smuggler
Sep 13, 2004
17,373
0
SF
# find /dir -name somename* -exec cp {} {}.jpg \;

Keep in mind, no matter how you select your photos, at some point you have to identify your files by some characteristic.

Typically it is filename, although there might be another other field or tag, like a description, which will uniquely identify your files.

While I normally do not recommend unix commands to solve problems, unix is the absolute best operating system for managing files on a large scale basis. However, it will require a different way of thinking about computers. PC's and Macs are designed to make it easy for the beginner users but more difficult for the power users, i.e. the GUI. Unix initially did not have a GUI, so their users have to think about the basic elements of file management, i.e. the Command Line Interface.

The only problem for me is that I am not familar with the exif format. However, if there was a simple cli, like exiftool, to interpret images and return your relevant fields, any unix script could do exactly what you want.
 

sanjuro

Tube Smuggler
Sep 13, 2004
17,373
0
SF
btw, I briefly looked over exiftool, and you wanted to use that, this is how I would change the names (btw, apologies to awk and perl users. ksh is my best known shell script).
Code:
#!/bin/ksh
for i in `find /dir` # this find statement can be modified to limit the filesearch
do
  if [[ `exiftool $i | grep "Date/Time" | cut -c30-45` = yourdate ]] ;
  then 
     cp $i $i.jpg
  fi
done
I can do in perl too. But I believe this script will work as is.
 

Toshi

butthole powerwashing evangelist
Oct 23, 2001
39,721
8,733
fraser, you ever get the script to download from the page i sent you?
 

Transcend

My Nuts Are Flat
Apr 18, 2002
18,040
3
Towing the party line.
fraser, you ever get the script to download from the page i sent you?
Ya, the script was pretty whack tho. It ended up requiring you to have cs2 installed, and even then it dropped one digit in the date so the year was 200 or the month was 0.

I am trying out the newwest version of better renamer with the EXIF stuff adn droplet creatipn, almost there I think. Only issue is i can't get it to run on ingestin i don't think.