Re: Get property size
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