• 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
Name comparison taking a long time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Name comparison taking a long time


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

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?

Thanks!

      - Rick Cohen

-----------------------------------------

property foo_foldername : "foo"


-- presents a dialog box with a localized prompt
-- if the user cancels the dialog box, an error is displayed
on run
set thePrompt to "Please locate your foo folder"

try
-- prompt the user for the folder
set FooFolder to choose folder with prompt thePrompt

-- get the displayed name, and compare it to "foo"
-- if the name is "foo", we've found it!
-- otherwise
set theInfo to info for FooFolder
if displayed name of theInfo is foo_foldername then
display dialog "Folder's name matches " & displayed name of theInfo
else
display dialog "Folder's name doesn't match: " & displayed name of theInfo
end if
on error errText number errNum
display dialog errText & ", error: " & errNum
end try

end run


_______________________________________________
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
  • Follow-Ups:
    • Re: Name comparison taking a long time
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: [OFFTOPIC] does anyone feel like giving me some perl assistance off list?
  • Next by Date: Re: Name comparison taking a long time
  • Previous by thread: Re: A Better Regex
  • Next by thread: Re: Name comparison taking a long time
  • Index(es):
    • Date
    • Thread