• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Trying to get image dimensions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Trying to get image dimensions
      • From: Shane Stanley via AppleScript-Users <email@hidden>
  • Next by Date: Re: Trying to get image dimensions
  • Next by thread: Re: Trying to get image dimensions
  • Index(es):
    • Date
    • Thread