Image Events and metadata tag class

I’m new in scripting Applescript.
I try to read with Image Events the date and time of image creation (Exif tag).
In Image Events there is a “Class metadata tag: A metadata tag: EXIF, IPDC, etc.” but I don’t know how to use it.
Thank you for your help.

I did have image events working, but it seems to be broken for me now.

However you can use it like this.


tell application "Image Events"
set thisFile to open file "Path:to:your:image:file.jpg"
set numberOfTags to the count of metadata tags of thisFile
set metaDataNames to {} -- empty list
set metaDataValues to {} -- empty  list

repeat with i from 1 to the numberOfTags
copy the (value of (metadata tag i of thisFile)) to the end of theMetaDataValues
copy the (name of (metadata tag i of thisFile)) to the end of theMetaDataNames
end repeat
end tell

This will create two lists, one containing the names of the metatags and the other containing the values.

As I said, my “Image Events” is broken so I can’t test this, I just remembered that the commands behaved as I would expect from the dictionary.

Kevin

Thank you. It works well. I just correct names of variables.

This code above can be simplified to:

Tested in Mac OS 10.3.2 and soon to be incorporated into Name those Files!.

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

I’m tring to set meta data tags. I’ve got the script reading them all and displaying them all in a dialog.

For now, I’m just trying to read the value of the specific tag like this:

tell application "Image Events"
	launch
	set the_file to open the_file
	set copy_right to get value of metadata tag whose name is "copyright"
	tell application "Finder" to display dialog ("MetaData copyright: " & copy_right) buttons {"OK"} default button 1
end tell

only, it gives me an error “Can’t get <> of <>”

BTW: for those of you who are having trouble with Image Events, you need to tell it to launch first as in my sample above.

Any hints?