From the "I am too stupid for this" department

by Volker Weber

Automator is one of those great promises of Mac OS X Tiger which never worked for me. In theory, everybody should be able to plug a few actions together to automate repeating chores. But I am too stupid for this.

Let me give you a sample workflow that should kick in once I connect my camera:

  1. Create temporary folder
  2. Copy all photos from camera to folder
  3. Open a bash shell
  4. cd to the temporary folder
  5. Run perl script ~/bin/exifcleaner.pl with parameter -p
  6. Import photos into iPhoto
  7. Remove photos and temporary folder

Copying from the camera is too hard? OK, assume the photos are already in the folder.

Comments

One more reason I'm still using Panther and will be for the foreseeable future.

Adam Merkert, 2005-10-23 06:55

This is a complete solution for importing pictures into a directory structure, organized by copying date (eg. .../2005/10/20051025).
"Development time": approx 20 minutes including debugging.
You need to change the processing from cp .../*/*/... to a find invocation when your file list on the CF card would grow beyond the limit of 64k-2 elements (command line arguments to cp in this case).

It would be your turn to add the appropriate osascript invocation for automagic import into iPhoto.
exiftran is a tool for handling EXIF data in JPEG files which is contained in the fbida package. Installation of exiftran and libexif-0.6.x via configure && make install is left as an exercise to the reader.

#!/sw/bin/zsh

###
### copy files from the digicam to a target folder
### EXIF chunks are normalized and image autorotation with exiftran
### alpha@webmonster.de 2005
###

DT="`/bin/date +%Y%m%d`"
DM="`/bin/date +%m`"
DY="`/bin/date +%Y`"
TRG="/Volumes/PictureStash/Digi"
SRC="/Volumes/EOS_DIGITAL/DCIM"

TRG="${TRG}/${DY}/${DM}/${DT}"

if [ ! -d ${SRC} ]
then
echo "### source not mounted: ${SRC}"
exit 99
fi

if [ ! -d ${TRG} ]
then
echo "### creating ${TRG}"
mkdir -p ${TRG}
fi

echo "### source: ${SRC}"
echo "### target: ${TRG}"
echo "### Trying CRW..."
cp -v ${SRC}/*/*.[Cc][Rr][Ww] ${TRG}
echo "### Trying AVI..."
cp -v ${SRC}/*/*.[Aa][Vv][Ii] ${TRG}
echo "### Trying JPEG..."
for image in ${SRC}/*/*.[Jj][Pp][Gg]
do
echo "${image:t} from ${image:h}"
exiftran -a -o ${TRG}/${image:t} ${image}
done

echo "### done."

Post a comment











Shall I remember this for you?




Use your full name and a working email address. Unless you want your comment to be removed. No kidding.



Ceci n'est pas un blog

vowe.net is a personal website published by Volker Weber a.k.a. vowe. I am an author, consultant and systems architect based in Darmstadt, Germany.

rss Click here to subscribe

Hello

About me
Contact
Publications
Certificates
Frequently asked questions

Twitter Updates

More >

Poll

Which BlackBerry could be your next one?

Getting poll results. Please wait...

Local time is 13:40

visitors.gif
134 visitors online

News

Other sources of news, imported into my own format to make them more accessible:

Heise Online
Schlagzeilen
Weather

Archives

As most of my articles roll off the front page rather quickly, I am making an archive of previous posts available here. You can also use the handy search box at the top of the page if you are looking for something particular.

Last 30 days
More archives

Got the T-shirt?

Got the T-shirt?
Are you buying from the US?

Systems Architecture

This site runs on an Apache web server on top of the Linux operating system. The content is managed with MovableType which is implemented in Perl. Last but not least the HTML code your browser sees is put together with PHP.

© 1992-2008 Volker Weber.
All Rights Reserved.

Impressum