Re: Determing the Size of a File
Re: Determing the Size of a File
- Subject: Re: Determing the Size of a File
- From: Scott Earleywine <email@hidden>
- Date: Wed, 02 May 2001 18:46:55 -0500
Is there a way to make this a droplet?
I pasted the code, but when I run it...the file I had selected (obviously)
deselects and the script 'checks' the compiled script's size.
<sorry if this is a dumb question...I'm new>
Thanks!
SLE
--
Scott Earleywine
email@hidden
http://www.bigfoot.com/~earleywine_scott/
>
From: Michelle Steiner <email@hidden>
>
Date: Wed, 2 May 2001 14:07:17 -0700
>
To: <email@hidden>
>
Subject: Re: Determing the Size of a File
>
>
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. |
>
----------------------------------------------------------------------
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users