Is it me, or Graphic Converter's scripting is buggy?

Hello scripters,

I’m trying to do something that should be simple but it does not work. Other times things work then don’t work in a seemingly random fashion.

Here it is :

version 1:

set myfile to choose file
tell application "GraphicConverter"
	open myfile
	set myExif to exiftext of window 1
end tell

result:
get exiftext of window 1
“GraphicConverter got an error: Some data was the wrong type.”

version 2:

set myfile to choose file
tell application "GraphicConverter"
	open myfile
	get exiftext of window 1
	set myExif to result
end tell

result: OK

version 3:

set myfile to choose file
tell application "GraphicConverter"
	get file exif of myfile -- same with "file iptc" 
end tell

result:
open alias “HD:somefile.jpg”
get file exif alias “HD:somefile.jpg”
“GraphicConverter got an error: An error of type -2 has occurred.”

version 4:

set myfile to choose file
tell application "GraphicConverter"
	get file imageinfo of myfile
end tell

result: OK

So, what’s going on here? Am I missing something or the scripting is buggy?

furthermore, what does this mean?

get exif‚v : read the exif data from an image
get exif
value integer : the exif number
[description boolean] : returns the exif data with the description/meaning like “Creation Date:”
→ string

What is the exif number?

If I do an [get exif of window 1], I get a “paramater missing” error. It is probably that value, but how do you reference it? Tyring [exif 1] - "access not allowed. Trying [{exif:1}] give nonsense results ({exif:1} is treated as a variable). Trying [(exif,1)] gives "get exif of window 1 - “GraphicConverter got an error: Some data was the wrong type.”

And the following is even more nebulous:

set date from content‚v : Set the file creation date from the EXIF content of the file (if available)

How do you reference the file?

This:

set myfile to choose file
tell application "GraphicConverter"
	set date from content of myfile
end tell

results in this:

set date from content alias “HD:somefile.jpg”
“GraphicConverter got an error: An error of type 1 has occurred.”

I DON’T GET IT! Can someone please help out here?

Model: CUBE
AppleScript: 1.10.7
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

PHEW! - so it was me…

Thanks a lot for your help!

:smiley:

Hi, Asu.

I think Jacques has probably covered most of this (I’ll read his post more thoroughly in a moment), but as I’ve just written this out after doing the research, I’ll post it as a supplemental reply… :slight_smile:

Looking at GraphicConverter’s dictionary, exiftext, exif, and file exif, aren’t properties of windows, but parts of the commands get exiftext, get exif, and get file exif. That is, get exiftext is a GraphicConverter command in its own right, not AppleScript’s get command followed by something that has to be got. Similarly with get file imageinfo. It’s not buggy, but it could be accused of being a little inelegant.

Since exiftext, say, is part of a command and not a property of a window, the window becomes the direct parameter of the command, not the owner of the exiftext. So the of keyword isn’t needed.

set myfile to (choose file)
tell application "GraphicConverter"
	open myfile
	set myExif to (get exiftext window 1)
end tell

With regard to your get file exif example, I get the same error as you when the file doesn’t have any exif info, but lots of interesting information when it does. I think GC should really allow for the data not existing, but you can get round it with a try block:

set myfile to (choose file)
tell application "GraphicConverter"
	try
		get file exif myfile
	on error number -2
		-- This is the same string as is returned by 'get exiftext' when there's no such data.
		"the file contains no exif data"
	end try
end tell[/b]

With regard to the exif number, I suppose you need to be familiar with exif information, which I’m afraid I’m not. Comparing the list of strings returned by my successful attempt with get file exif and experiments with get exif applied to a window showing the same file, the exif value seems to correspond to “Unknown tags” in the data. For instance, one of the strings in the list returned by get file exif is “$927C,$0002,Unknown tag (2),{2,432,290,217}”. Using get exif on the same image with a value of 2 returns the bit in the braces:

set myfile to (choose file)
tell application "GraphicConverter"
	open myfile
	get exif window 1 value 2
	--> "{2,432,290,217}"
end tell

As I said, I don’t know anything about handling exif data, but I hope this helps a little with GraphicConverter’s scripting quirks.