• 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: Robert Poland <email@hidden>
  • Date: Sat, 18 Jan 2014 12:08:36 -0700

On Jan 18, 2014, at 11:10 AM, Christopher Stone <email@hidden> wrote:

> 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?

No, I wanted the size.

Got this from Yvan;
set thePicture to (choose file) as alias
tell application "System Events" to set the_size to size of disk item (thePicture as text)

> 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

Robert Poland - Fort Collins, CO




 _______________________________________________
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


References: 
 >Get property size (From: Robert Poland <email@hidden>)
 >Re: Get property size (From: Christopher Stone <email@hidden>)

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