Re: Problems with speed & "Info For"
Re: Problems with speed & "Info For"
- Subject: Re: Problems with speed & "Info For"
- From: Brian Johnson <email@hidden>
- Date: Thu, 31 Jan 2002 08:43:03 -0800 (PST)
On Wed, 30 Jan 2002, Kai Edwards wrote:
[snip]
>
One vanilla possibility that springs to mind is:
>
>
tell application "Finder"
>
kind of theItem
>
end tell
[snip]
I had not thought of this! so last night I did some experiments. I thought
the esults might be worth sharng:
1 - kind of afile -> (depends of file) --(duh)
2 - kind of alias-to-afile -> alias -- good!
3 - kind of afolder -> folder -- awright!
4 - kind of alias-to-afolder -> folder -- ... sigh
I really need to be able to tell an alias to a folder from the original
folder. So I tried using xResolver out of Tanaka's OSAX (the 1.3 version)
to build an alias test..
set y to xResolver x -- class of x is alias
set t1 to x = y
vs.
set y to info for x
set t2 to alias of y
The "info for" solution is actually lots faster (11 vs 3 seconds in a 500
count repeat loop) if the target folder is small (38 items, 1.4MB).
Interestingly, if the target is an alias to the folder or a file, it takes
longer (14 v. 9 and 15 v. 10, respectively) and if it's a simple file they
come out about equal (10 v. 10). For now, the "info for" solution seems
like the winner, even if the resulting script is fairly slow in some
cases.
Brian Johnson, Dept of Architecture, University of Washington, Seattle