Re: Name comparison taking a long time
Re: Name comparison taking a long time
- Subject: Re: Name comparison taking a long time
- From: Emmanuel <email@hidden>
- Date: Thu, 16 Aug 2007 16:26:32 +0200
At 10:15 AM -0400 8/16/07, email@hidden wrote:
Hi folks,
I have a simple Applescript attached below. It uses "choose folder"
to prompt the user to select a folder named foo. If the user clicks
on a folder named foo, a message is quickly displayed saying so.
However, if the user clicks a folder with a different name, for some
reason that dialog informing them of this takes much longer. It
also seems to take even longer if the wrong folder is selected near
the top level of the disk. For example, I use the "Developer"
folder at the top level of my "Macintosh HD" for testing.
Any ideas why there is a delay, and how I can minimize this delay?
set theInfo to info for FooFolder
This is the culprit. Getting "info for" implies computing the total
size of the folder (since "info for" returns, among other stuff, the
item's size.)
So, you have to use another way of finding the folder's name. Such as:
------ untested
set AppleScript's text item delimiters to ":"
set thename to item -2 of text items of (FooFolder as text)
Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden