Read/write EXIF/IPTC

Is it possible to read/write EXIF/IPTC data in images?

If i want to tag image file without using Finder comments field, how i do that?

Hi cirno,

you can read a few EXIF tags with Image Events like this

tell application "Image Events"
	set theImage to open alias "Path:to:Image"
	set {nameList, valueList} to {name, value} of metadata tags of theImage
end tell

the result is nameList and valueList, which contain names and values of the metadata.
However Image Events can’t read all EXIF data, if you need all, use a programm like Graphic Converter instead

As Stefan say’s GC maybe what you are looking for.

More Stefan exif examples HERE

And for editing IPTC of images. (note it overwrites ALL iptc)
Check THIS thread out, the final script is on post #20

Also Here is one I wrote to read IPTC

set Caption_ to "1"
set Caption_writer to "2"
set Headline_ to "3"
set Instructions to "4"
set Byline_ to "5"
set Byline_Title to "6"
set Credit_ to "7"
set Source_ to "8"
set title_ to "9"
set Unknown1_ to "10"
set City_ to "11"
set State to "12"
set Country_ to "13"
set reference_ to "14"
set Categories_ to "15"
set Supplemetal_Categories to "16"
set Unknown2 to "17"
set Keywords_ to "18"
set Copyright_notice to "19"
set _URL to "20"
set event_ to "21"
set people_ to "22"
global Caption

set img_file to choose file of type {"public.image"} with prompt "Choose an image file:" without invisibles
	tell application "GraphicConverter"
		set IPTC_ to get file iptc img_file
	end tell
	set Caption to "Caption : 
" & item Caption_ of IPTC_ & return & return & "HeadLine :
" & item Headline_ of IPTC_ & return & " Byline:
" & item Byline_ of IPTC_ & return & " Source :
" & item Source_ of IPTC_
end try

ExifTool is too complicated for my skills and i cant use Finder Comments, because GraphicConverter deletes Finder Comments when user moves files using GC browser. Some of these instructions requires that GC is running and in this case that is not possible.

I only need to add two tags to png picture, short text and url.

It can store these two text snippets anywhere as long it isnt Finder Comments. Thanks