• 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: Determing the Size of a File
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determing the Size of a File


  • Subject: Re: Determing the Size of a File
  • From: Michelle Steiner <email@hidden>
  • Date: Wed, 2 May 2001 14:07:17 -0700

On 5/2/01 10:18 AM, email@hidden
<email@hidden> wrote:

>Is there any possible routine I could use to display the size of a file in a
>human readable form (For example 1.5 Megs etc.)

tell application "Finder"
set the fileSize to the size of item 1 of the selection
end tell
set the units to "bytes"
if fileSize is greater than 1024 then
set the fileSize to my roundit(fileSize / 1024)
set the units to " kilobytes"
end if
if the fileSize is greater than 1024 then
set the fileSize to my roundit(fileSize / 1024)
set units to " megabytes"
end if
display dialog "The file is " & fileSize & space & units

to roundit(inputsize)
return (round inputsize * 10) / 10
end roundit

--Michelle

----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------


  • Follow-Ups:
    • Re: Determing the Size of a File
      • From: Scott Earleywine <email@hidden>
  • Prev by Date: Triggering a QuicKeys Shortcut
  • Next by Date: Script Editor odd behaviour
  • Previous by thread: Re: Determing the Size of a File
  • Next by thread: Re: Determing the Size of a File
  • Index(es):
    • Date
    • Thread