#!/bin/sh
#
# Sample script to import metadata into fields of an archive index.
# In this example we are using mdls to read metadata attributes for
# the specified file.
# 
# This script sets as metadata 
# colorspace, imagesize and findercomment. These fields are
# to be prepared in the archive database.      
# 
# Syntax: metadata_ImageMac.sh filename
# --------------------------------------------------------

attr1=`mdls -raw -name kMDItemColorSpace "$1"`
attr2=`mdls -raw -name kMDItemPixelWidth "$1"`
attr3=`mdls -raw -name kMDItemPixelHeight "$1"`
attr4=`mdls -raw -name kMDItemFinderComment "$1"`
#
echo "colorspace {$attr1} imagesize {$attr2 x $attr3} findercomment {$attr4}"
#
# EOF


