Re: file size and creation date
Re: file size and creation date
- Subject: Re: file size and creation date
- From: Andy Wylie <email@hidden>
- Date: Tue, 12 Mar 2002 22:46:15 +1300
on 12/3/02 9:04 PM, email@hidden at email@hidden
wrote:
>
Hi all,
>
>
I have two problems I hope someone can answer.
>
>
First, get creation date returns what I looking for, but I only need the
>
date, not the time. How do I script to only get the date?
>
Unfortunately you have to get it and format it from it's elements without an
OSAX or scripting addition, see the 'Standard Additions' dictionary or
search the list archive ("date format") for more.
>
>
Second, get size returns some odd value. I only need the file size, either
>
in kilobyte" or in megabyte.
>
again you need to format the result...
tell application "Finder"
set |size| to size of theFile
end tell
set {bytes, cnt} to {{"kb", "mb", "gb"}, 0}
repeat until |size| < 1024
set {|size| ,cnt} to {|size| / 1024, cnt + 1}
end repeat
set |size| to ((|size| as text)'s text 1 thru 6) & bytes's item cnt
--note: from Finder's dictionary...
--size integer [r/o] -- the logical size of the item
--physical size integer [r/o] -- the actual space used by the item on disk
--[r/o] = read only
_____________________________ 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.