• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Name comparison taking a long time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Name comparison taking a long time


  • Subject: Re: Name comparison taking a long time
  • From: email@hidden
  • Date: Thu, 16 Aug 2007 10:45:48 -0400

Brilliant! Thanks. I didn't know that you could use negative numbers to index into a list of items.

        - Rick


Emmanuel wrote:
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
References: 
 >Name comparison taking a long time (From: email@hidden)
 >Re: Name comparison taking a long time (From: Emmanuel <email@hidden>)

  • Prev by Date: Re: Name comparison taking a long time
  • Next by Date: Changing ownership of a folder and all contents
  • Previous by thread: Re: Name comparison taking a long time
  • Next by thread: Re: Name comparison taking a long time
  • Index(es):
    • Date
    • Thread