Image Events - get properties problem

Using Apple’s get properties scripts work fine on my Powerbook - but fail to return any values on my G4 - both running 10.38 standard systems, same software etc. See event log -

get properties of image "ddvh 55.JPG"
	{bit depth:missing value, file type:missing value, image file:file "ddvh1:dd vh1 1:1:ddvh 55.JPG", location:folder "ddvh1:dd vh1 1:1:", resolution:{}, class:image, dimensions:{}, name:"ddvh 55.JPG", color space:missing value}
close image "ddvh 55.JPG"

Any ideas anyone???

For a start I assume that’s not your entire script, right? It’s at least within a ‘tell application “Image Events”’ block, right?

On that basis the first problem I see is:

get properties of image "ddvh 55.JPG" 

How does Image Events know what “ddvh 55.JPG” is?
As far as the script is concerned “ddvh 55.JPG” is nothing more than a string of characters. Since it’s a quoted string it clearly isn’t a variable name (e.g. some image you’ve previously opened and while you may see this as a filename, it isn’t - at the very least it should have some path elements to it (e.g. “HD:Users:jack:Desktop: ddvh 55.JPG”) so the app as some chance of finding it.

Additionally, if you are providing a path you usually need to be more specific and tell the system you’re handing it a file. I’d expect to see this line written more like:

tell application "Image Events"
	get properties of file "HD:Users:jack:Desktop: ddvh 55.JPG"
end tell

Thanks. Yes that’s only a bit of the script I put in to show that it was returning nothing in the dimension and resolution fields. It’s finding the file OK, and works perfectly on my powerbook - but not on my G4. That’s the puzzle. The whole script displays the selected file’s resolution and size in centimeters.

Jack,

If you can’t find a solution with Image Events, you might consider iMagine Photo, it is very similar in concept to Image Events but with a much larger range of functionality. It is also free. See my signature for website link etc.

The properties returned from a graphic importer object are very similar to those returned by Image Events.


set theFile to choose file
tell application "iMagine Photo"
  set thisImporter to import graphic theFile
  set theProps to the properties of thisImporter
  close thisImporter
  theProps
end tell

But included in the list of properties is the component error. This gives you an error code if “iMagine Photo” had trouble understanding the image file, (if it has been damaged for example), where “Image Events” doesn’t tell you what is happening.

Kevin