Re: File size
Re: File size
- Subject: Re: File size
- From: email@hidden (Michael Sullivan)
- Date: Fri, 3 May 2002 15:21:20 -0400
- Organization: Society for the Incurably Pompous
>
Hi all,
>
Anyone how knows how to get the size (MB) of a file from the finder?
>
>
My script only give me some odd result.
>
>
The script:
>
>
copy "Macintosh HD:Script_folder:images_to_database:" as text to the_vol
>
set searchFolder to (the_vol & "in:")
>
set myList to list folder alias searchFolder without invisibles
>
repeat with myFilename in every item in myList
>
set theFile to alias (searchFolder & myFilename)
>
tell application "Finder"
>
get size of theFile
>
end tell
>
end repeat
>
-- result: 1.75208E+5
>
-- The size of the file is 172 K according to Finder.
You got the size in bytes.
Divide by 1024 to get the size in KB, or 1024^2 to get the size in MB.
Michael
--
Michael Sullivan
Business Card Express of CT Thermographers to the Trade
Cheshire, CT email@hidden
_______________________________________________
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>) |