Re: Mail GUI script error (koenig.yvan)
Re: Mail GUI script error (koenig.yvan)
- Subject: Re: Mail GUI script error (koenig.yvan)
- From: Douglas Stetner <email@hidden>
- Date: Thu, 28 Feb 2013 12:33:39 +1000
ls is giving you ( see 'man ls' ):
the number of file system blocks actually used by each file, in units of 512 bytes,
where partial units are rounded up to the next integer value. If the output is to a terminal,
a total sum for all the file sizes is output on a line before the listing. The environment
variable BLOCKSIZE overrides the unit size of 512 bytes
so it is not looking into your other directories and it is only counting files.
RTFM
Doug
On 28/02/2013, at 06:00 , email@hidden wrote:
> Send AppleScript-Users mailing list submissions to
> email@hidden
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.apple.com/mailman/listinfo/applescript-users
> or, via email, send a message with subject or body 'help' to
> email@hidden
>
> You can reach the person managing the list at
> email@hidden
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of AppleScript-Users digest..."
>
>
> Today's Topics:
>
> 1. Re: Mail GUI script error (Shane Stanley)
> 2. Re: Mail GUI script error (koenig.yvan)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 27 Feb 2013 11:22:37 +1100
> From: Shane Stanley <email@hidden>
> To: liste AppleScript US <email@hidden>
> Subject: Re: Mail GUI script error
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=us-ascii
>
> On 27/02/2013, at 12:25 AM, koenig.yvan <email@hidden> wrote:
>
>> I forgot that ASObjC Runner is able to return the true size of a folder.
>> Finder and System Events return the value missing only.
>
> Maybe I'm missing something, but a quick check with a package here gets the size OK with both Finder and SE. Is it just a problem with larger directories?
>>
>> Once I thought to the shell command ls but this one returns the physical size, not the total count of bytes.
>
> Are you sure about that? If I use ls with a Pages package, and add up all except the actual folder sizes, I get the same as in Get Info.
>
>
> --
> Shane Stanley <email@hidden>
> 'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 27 Feb 2013 10:04:25 +0100
> From: "koenig.yvan" <email@hidden>
> To: liste AppleScript US <email@hidden>
> Subject: Re: Mail GUI script error
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset="iso-8859-1"
>
>
> Le 27/02/2013 à 01:22, Shane Stanley <email@hidden> a écrit :
>
>> On 27/02/2013, at 12:25 AM, koenig.yvan <email@hidden> wrote:
>>
>>> I forgot that ASObjC Runner is able to return the true size of a folder.
>>> Finder and System Events return the value missing only.
>>
>> Maybe I'm missing something, but a quick check with a package here gets the size OK with both Finder and SE. Is it just a problem with larger directories?
>>>
>>> Once I thought to the shell command ls but this one returns the physical size, not the total count of bytes.
>>
>> Are you sure about that? If I use ls with a Pages package, and add up all except the actual folder sizes, I get the same as in Get Info.
>
>
> I re-ran the script used yesterdays and got different results.
> I can't work with a tool which returns missing value from time to time and the correct one at other times.
>
> The script :
> set paquet to "Macintosh HD:Users:yvankoenig:Desktop:Léo Ferré CDs.pages:"
>
> tell application "System Events"
> activate
> size of disk item paquet
> end tell
>
> tell application "Finder"
> size of item paquet
> end tell
>
> quoted form of POSIX path of paquet
> do shell script "ls -@lh " & result
>
> tell application "ASObjC Runner"
> set fileInfo to about file paquet include only "size" with directory size
> end tell
>
> The log report :
>
> tell application "System Events"
> activate
> get size of disk item "Macintosh HD:Users:yvankoenig:Desktop:Léo Ferré CDs.pages:"
> --> 2013900
> end tell
> tell application "Finder"
> get size of item "Macintosh HD:Users:yvankoenig:Desktop:Léo Ferré CDs.pages:"
> --> 2013900
> end tell
> tell current application
> do shell script "ls -@lh '/Users/yvankoenig/Desktop/Léo Ferré CDs.pages/'"
> --> "total 3816
> -rw-r--r-- 1 yvankoenig staff 1.7M Feb 26 14:12 104_0469 2.JPG
> -rw-r--r-- 2 yvankoenig staff 64K Feb 20 22:13 2013-02-20T22.06.10.png
> drwxr-xr-x 3 yvankoenig staff 102B Feb 26 14:13 Contents
> drwxr-xr-x 3 yvankoenig staff 102B Feb 26 14:13 QuickLook
> -rw-r--r-- 1 yvankoenig staff 355B Feb 26 14:13 buildVersionHistory.plist
> -rw-r--r-- 1 yvankoenig staff 78K Feb 26 14:13 index.xml.gz"
> end tell
> tell application "ASObjC Runner"
> about file "Macintosh HD:Users:yvankoenig:Desktop:Léo Ferré CDs.pages:" include only "size" with directory size
> --> {name:"Léo Ferré CDs.pages", size:2013900}
> end tell
>
> The package contents :
>
> 104_0469 2.JPG >> 1794516 bytes
> 2013-02-20T22.06.10.png >> 65540 bytes
> buildVersionHistory.plist >> 355 bytes
> Contents > PkgInfo >> 8 bytes
> index.xml.gz >> 79415 bytes
> QuickLook > Thumbnail.jpg >> 74066 bytes
>
>
> Yvan KOENIG (VALLAURIS, France) mercredi 27 février 2013 10:04:00
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20130227/604c8c71/attachment.html>
>
> ------------------------------
>
> _______________________________________________
> AppleScript-Users mailing list
> email@hidden
> https://lists.apple.com/mailman/listinfo/applescript-users
>
> End of AppleScript-Users Digest, Vol 10, Issue 71
> *************************************************
_______________________________________________
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