Re: How do I format a number or Round a number?
Re: How do I format a number or Round a number?
- Subject: Re: How do I format a number or Round a number?
- From: Nigel Garvey <email@hidden>
- Date: Sun, 12 Oct 2003 17:13:32 +0100
In his message of 12/10/2003 15:43 BST, Kai wrote:
>
on Sun, 12 Oct 2003 14:06:46 +0100, Nigel Garvey wrote:
>
>
> John Cochrane wrote on Sun, 12 Oct 2003 14:24:59 +1000:
>
>> However I find that they both have problems if used to get the size of a
>
>> folder. The first time that the scripts are run they return a missing
value.
>
>> If repeated they return a result...
>
Interestingly, the Finder in OS 9 appears to wait until it has calculated a
>
useful value before replying...
... and its 'size' and 'physical size' figures agree with the information
windows for both folders and disks. The figures agree for folders in OS
X, but not for disks - on my machine, anyway:
In OS 9, script and information window, machine's own HD:
3.64 GB (3911000064 bytes)
In OS X, script, same disk:
3.58 GB (3713737965 bytes)
In OS X, information window, same disk:
3.64 GB (3911004160 bytes)
>
> I can duplicate the 'missing value' effect in Mac OS X immediately after
>
> logging in. Forcing the Finder to 'update' the folder before getting its
>
> size seems to do the trick.
>
> set theFolder to (choose folder)
>
> tell application "Finder"
>
> update theFolder with necessity
>
> repeat
>
> set {_physicalSize, _size} to theFolder's {physical size, size}
>
> if the result does not contain missing value then exit repeat
>
> end
>
> end tell
>
>
Since 'update' alone doesn't do it, Nigel - and the checking loop seems to
>
work here without 'update', I suspect that's where the solution really lies.
Ah, right. Yes. It's the same here. Omit the 'update' line then. Thanks,
Kai. :-)
NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.