Trying to get image dimensions
Trying to get image dimensions
- Subject: Trying to get image dimensions
- From: Jenni via AppleScript-Users <email@hidden>
- Date: Tue, 2 Jun 2020 16:32:52 -0700
I used to use iMagine Photo to get the dimensions of images, but that
no longer works under Catalina. So after some searching, it looks like Image
Events may do that, as well. However, I can’t get the dimensions to be
returned. Here’s a sample script:
set selectedFile to (choose file)
tell application "Image Events"
set openedFile to open (selectedFile as alias)
set dimensionList to the dimensions of openedFile
set fileWidth to the first item of dimensionList
set fileHeight to the second item of dimensionList
close openedFile
end tell
Line 4 gives me this error:
"Can’t get dimensions of missing value.”
If I try to use the file directly like this:
set dimensionList to the dimensions of selectedFile
I get this error: "Image Events got an error: Can’t get dimensions of alias …"
Does anyone know of another way I can do this?
Thanks,
Frank
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden