re: Get File Size - Mac OS 9
re: Get File Size - Mac OS 9
- Subject: re: Get File Size - Mac OS 9
- From: Charles Arthur <email@hidden>
- Date: Fri, 6 Dec 2002 11:59:57 +0000
On Thu, 5 Dec 2002 10:30:41 -0800, Charles Heizer <email@hidden> wrote:
>
I'm not having much luck. I'm trying to write a script to get the size
>
(in bytes) of a file. does anyone have n example of this?
set thefile to choose file
set thesize to size of (get info for thefile)
--> tell current application
choose file
--> alias "Hard Disk:Desktop Folder:AppleShare Server Messages"
info for alias "Hard Disk:Desktop Folder:AppleShare Server Messages"
--> {name:"AppleShare Server Messages", creation date:date
"Tuesday, August 21, 2001 9:58:13 pm", modification date:date "Wednesday,
September 18, 2002 10:30:55 am", icon position:{704, 28}, visible:true,
size:18092, folder:false, alias:false, locked:false, busy status:false,
file creator:"ttxt", file type:"TEXT", short version:"", long version:"",
default application:alias "Hard Disk:Applications:Apple Tools:SimpleText"}
end tell
--> 18092
Doesn't even need the Finder.
However for the later problem:
>
Hello,
>
I'm trying to set a file to check for existence.
>
>
set theLoginFile to (file "Login" of system folder)
>
>
I have a script to setup the multiuser on my systems but I want to
>
check for the Login file first and it does not seem to work. I keep
>
getting "Can't get file "Login" of system folder."
This is interesting. If you try "set thefile to choose file" and navigate
to the system folder, you can't choose "Login" - it doesn't show up as a
file. (A few things that I've got dotted about my system folder which to me
look like files don't show up either in the "choose file" dialog - eg one
called "Daybook Review.uin", deposited there by some software I was trying
out.)
I don't know whether that's a weakness of the choose file dialog or
what. But when I tried "set thefile to file "Login" of system folder" -
which I do have - it errored. When I tried "alias "Login" of system folder"
it also errored.
So Login must somehow lie outside the purview of the "file"
definition (it's file type FNDR, creator type fred). Maybe you'd need to
access it through some other API - though I can't see anything obvious in
either Standard Additions or the Finder dictionaries.
Oh, where is Chris Nebel at times like these..
best
Charles
----------------------------
http://www.ukclimbing.com : 1100+ British crags, 350+ British climbing
walls - searchable by distance and anything else you care to think of -
with weather forecasts for every one, plus maps, articles, news and
features. And there's even a cool shop attached.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________
_______________________________________________
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.