Re: File size
Re: File size
- Subject: Re: File size
- From: Andy Wylie <email@hidden>
- Date: Sat, 04 May 2002 09:28:47 +1200
on 4/5/02 2:00 AM +1200: Peter Mathiessen wrote:
>
Hi all,
>
>
Anyone how knows how to get the size (MB) of a file from the finder?
>
on Chew(Chomp)
set {bytes, cnt} to {{"bytes", "kB", "mB", "gB", "tB", "pB", "eB"}, 0}
repeat until Chomp < 1024
set {Chomp, cnt} to {Chomp / 1024, cnt + 1}
end repeat
tell Chomp to return ((it div 1) + (it mod 1) * 100 div 1 * 0.01) &
bytes's item (cnt + 1) as string
end Chew
tell application "Finder" to set |size| to largest free block
Chew(|size|)
-- "37.89mB"
_____________________________ Andy
_______________________________________________
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.
References: | |
| >File size (From: Peter Mathiessen <email@hidden>) |