• 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 10:54:42 -0700

Thanks again, Yvan,

On Jan 18, 2014, at 10:30 AM, koenig.yvan <email@hidden> wrote:

>
> Le 18/01/2014 à 18:12, Robert Poland <email@hidden> a écrit :
>
>> Hi,
>>
>> I’m trying, using Applescript, to get the size of an image.
>>
>> This is as far as I get;
>>
>> set ThePicture to choose file
>> tell application "Finder" to set x to properties of ThePicture
>>
>> How do I extract the size?
>>
>> TIA,
>>
>> Robert Poland
>
> As far as I know, the set of properties returned by the Finder didn't changed for years.
>
> set thePicture to ((path to desktop as text) & "The Great Wave.jpg") as alias
>
> tell application "Finder" to set x to properties of thePicture
> (*
> Snip…
> *)
> set theSize to size of x
> --> 1359930
>
> From my point of view it's more efficient to extract it with System Events
>
> set thePicture to ((path to desktop as text) & "The Great Wave.jpg") as alias
>
> tell application "System Events" to set the_size to size of disk item (thePicture as text)
> —> 1359930
>
> But, are you really wanting the size of the file or the dimensions of the picture ?

That’s what I wanted.

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

> Yvan KOENIG (VALLAURIS, France) samedi 18 janvier 2014 18:30:21

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: "koenig.yvan" <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