Re: Problems with speed & "Info For"
Re: Problems with speed & "Info For"
- Subject: Re: Problems with speed & "Info For"
- From: email@hidden
- Date: Tue, 29 Jan 2002 20:07:38 -0500
On Tue, 29 Jan 2002 10:12:34 -0800 (PST), Brian Johnson <email@hidden>
asked,
>
I've been following this discussion somewhat closely, as I have a fairly
>
mature script that works well enough, but I'm now trying to speed up. It
>
walks a folder hierarchy of HTML files, building links between them. In
>
the process I use "Info For" on just about every file in the hierarchy,
>
which probably accounts for some of the speed problems.
Info for can take many seconds when applied to a folder. The problem it has is
that one of the information pieces it provides is the size of a folder, which
requires it to rummage through the entire contents of the folder, adding up all
the file sizes. Users see this delay when they "Get Info [cmd-I]" for a folder,
and see "calculating size" in the info window, or when they display a list view
and have the option "Calculate Folder Sizes" checked, and see the sizes of each
folder appearing one every few seconds.
Many of the things you may want can be determined in other ways, mostly by
asking the Finder, and in a few cases by playing tricks with the items (like
examining it converted to a string to see if it ends with ":", or by trying to
convert it into an alias, to see if it exists). Additionally, there are
third-party scripting additions that do much of what you want and do it easily.
(Many of them came into existence before the scriptable Finder, to answer just
the questions people like you are asking.)
When I had to replace a slow "info for" handler call, I used "basic info for"
from Akua Sweets. It gets much of the information the standard Info For gets,
but not the slow stuff like folder size. There are also handlers in Galapagos
Suite, but they have such non-AppleScript names, like "getFileDataSize" (I
understand that these names result from the heritage of Tanaka's osax coming
from the Hypercard world, and I'm not looking a gift horse in the mouth. In
fact, working with this osax is probably good training for Unix.:-) )
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden