• 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
Re: Get property size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get property size


  • Subject: Re: Get property size
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 18 Jan 2014 12:10:19 -0600

On Jan 18, 2014, at 11:12, Robert Poland <email@hidden> wrote:
I’m trying, using Applescript, to get the size of an image.
______________________________________________________________________

Hey Bob,

tell application "Finder"
set sel to selection as alias list
if sel ≠ {} then
set f to first item of sel
{size, physical size} of f
end if
end tell

Size is the actual size of the image.

Physical size is the size of the image on disk.

You can also use 'mdls':

set f to quoted form of (POSIX path of f)
set _cmd to "mdls " & f & " | egrep -i \"size\""
do shell script _cmd

Are you perhaps looking for the dimensions of the image rather than the size?

mdls /Users/chris/Desktop/image.jpg |egrep -i "pixel"

OR

tell application "Image Events"
set _image to open f
set imgProp to properties of _image
close _image
imgProp
end tell

--
Best Regards,
Chris

 _______________________________________________
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: Get property size
      • From: Robert Poland <email@hidden>
References: 
 >Get property size (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Get property size
  • Next by Date: Re: Get property size
  • Previous by thread: Re: Get property size
  • Next by thread: Re: Get property size
  • Index(es):
    • Date
    • Thread