GraphicConverter Set IPTC Coment

Hi folks,
I ma not an experienced AppleScriptor. In fact, on a good day, with a strong wind behind me, I can AppleScript from here to there, but just barely. There are large holes in my ability to comprehend syntax in AS.

In graphicconverter 5.9, i am trying to set up a script to mark the IPTC comment (may also the keyword also in another script). I want this to happen in the browser view where one photograph is selected among others. Therefore the script must include a “get selected” or some iteration of that idea.

I heard from the folks at Lemke about some of it but I am not sure they understand the whole idea (I just sent another update their way I expect to hear back sometime tomorrow).

Mr. Lemke suggested the following:

tell application “GraphicConverter”
set file iptc “Your disk:your subfolder:thefile.jpg” to {“caption”,
“…”, “…”}

end tell

Problem is, this presumes I want it to act on a file somewhere on my drive. And I need to first get the file path name from the selected picture in GC. My humble fumbling follows. No, it is not working. And yes, I really am throwing darts at a dartboard in a dark room. I get the general idea of how AS works, but my following attempt is pretty randomly attempted.

Can anyone please show me how this should actually work - if it actually can work?

I also suggested they add a hot key command in the future so that this could be done in a keystroke (mark the comment as good picture, web picture, bad picture, etc).

try
tell application “GraphicConverter”
set theseFiles to selection of window 1
–set hereitis to path of selection
set file iptc theseFiles to {“caption”, “test”}
end tell
end try

Thanks
David Groover

I’m not sure about setting iptc (didn’t understand the dictionary or the menu pick and didn’t read the manual), but to get the selection on a browser page to the form indicated by Lemke this works (but not when combined):


tell application "GraphicConverter"
	activate
	set s to (selection of window 1)
	set s to s as text
end tell

This says a little more about EXIF and IPTC
http://www.cywarp.com/photoalbumexifiptc.htm

I heard back from the GraphicConverter folks. Changing something for a photo in a browser is currently not supported. I think GC still sees their product as something you can approach from the Finder and script per each photo. I am now seeing GC as a potential image cataloging and therefore, self contained piece of software.

I guess one of the ways I get frustrated with AppleScript is that AS seems a language for programers, based of the logic of programming, but in a “plain language” wrapper. Except it does not consistently follow programming syntax so it become frustrating to guess a solution through similar logic to something else that works.

I am still trying to understand how to get EXIF and IPTC data separated out. Using “iMagine Photo” I can get the EXIF results of a photo. But, I cannot turn that result into a new AS to tell Tex-Edit to parse the result. IT seems AS wont allow me to set the clipboard in Finder to the result nor will Tex-Edit paste the result. Did I mention that the logic of AS escapes me most of the time? :wink:

The following produces a result:

tell application “iMagine Photo”
set thisFile to choose file with prompt “Choose an image file containing exif data:” without invisibles
set thisImporter to import graphic thisFile
set exifInfo to the exif data of thisImporter
close thisImporter
exifInfo
end tell

I have a database app, Panorama by ProVUE http://www.provue.com/
that allows me to use AS within the procedure of trhe DB. So I am using that app to parse the result to a variable I know how to control, then back out again.

Thanks, lb

A common compaint I’m afraid. AppleScript’s real problem, however, is not it’s “Englishness” - it’s that interacting with an application depends entirely on how the developer of that application structured the dictionary – that is anything but uniform, so each new app. is a new challenge while you guess what the developer intended. Dictionaries can be very obscure, and in my view, GraphicConverter’s is in that category.

I responded to that thread. The difficulty is that you don’t say what you want to do – I’m supposed to guess from the TextEdit script.

I apologize. I ran two threads together. They came up while working the same problem, but they were different. I did post a new thread with just the new question. Basically, this last question you are trying to respond to (and posted elsewhere now) is that I was trying to take the AppleScript results and then run the Tex-Edit script to parse that data into a useful column of information.

I was trying to understand why I cant get the results from the first script into a Tex-edit document to parse with the second part. I hope that is more clear?

And yes, they do seem to have way different applications of their diction Aries. So much for Apple mandating common usage…? Too bad.

Thanks.

This seems to work for me.


set dataLabels to {"Info", "Make", "Model", "Created", "Orientation", "ExpTime", "Aperture", "Program", "ISO_Speed", "Capture_Date", "Bias_EV", "Meter_Mode", "Light", "Flash", "Focal_Length", "Width", "Height"}
tell application "iMagine Photo"
	set thisFile to choose file with prompt "Choose an image file containing exif data:" without invisibles
	set thisImporter to import graphic thisFile
	set exifInfo to the exif data of thisImporter
	close thisImporter
	exifInfo
	set EI to ""
	set tid to AppleScript's text item delimiters
	set AppleScript's text item delimiters to "Unutxt"
	repeat with k from 1 to count exifInfo
		set EI to EI & item k of dataLabels & ": " & text item 2 of ((item k of exifInfo) as text) & return
	end repeat
	set AppleScript's text item delimiters to tid
end tell
EI 

The problem seems to be that exifs have weird character formatting. I didn’t pursue that.