Re: Determing the Size of a File
Re: Determing the Size of a File
- Subject: Re: Determing the Size of a File
- From: hciR nellA <email@hidden>
- Date: Wed, 2 May 2001 17:28:04 -0800
-- simply example, works under OS X, did not check 9
on open (droppedFile)
tell application "Finder"
set fileSize to physical size of (item 1 of droppedFile)
end tell
display dialog (item 1 of droppedFile as string) & " is " & fileSize
end open
On Wednesday, May 2, 2001, at 03:46 PM, Scott Earleywine wrote:
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
_______________________________________________
applescript-users mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/applescript-users
- hcir
mailto:email@hidden
Made with a Mac!