• 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
Slow vs faster
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Slow vs faster


  • Subject: Slow vs faster
  • From: Luther Fuller <email@hidden>
  • Date: Thu, 06 Jan 2011 13:55:04 -0600

I have a very old script which I use often. Yesterday, I was watching it grind thru a long list of folders and wondering why it was so irritatingly slow in Snow Leopard. The script, with all the irrelevant stuff removed, looks like this ...

on recursivehandler(folderAlias)
tell application "Finder"
-- open window of folderAlias
-- do lots of stuff to window of folderAlias here
-- then ...


copy (sort folders of folderAlias by name) to folderList
repeat with innerFolder in folderList
select innerFolder
my recursivehandler(innerFolder) -- and many other parameters
end repeat

-- close window of folderAlias
end tell
end recursivehandler

For no good reason, I modified the code to this ...

on recursivehandler(folderAlias) -- and many other parameters
tell application "Finder"
-- open window of folderAlias
-- do lots of stuff to window of folderAlias here
-- then ...


copy (sort folders of folderAlias by name) to folderList
repeat with i from 1 to (count items of folderList)
set innerFolder to (item i of folderList) as alias
select innerFolder
my recursivehandler(innerFolder) -- and many other parameters
end repeat


-- close window of folderAlias
end tell
end recursivehandler

Now it runs noticeably faster. (but still not blazing fast)
But, why?

 _______________________________________________
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: Slow vs faster
      • From: Axel Luttgens <email@hidden>
    • Re: Slow vs faster
      • From: Christopher Stone <email@hidden>
  • Prev by Date: Re: variables vrs properties
  • Next by Date: Re: New to AppleScript,please help.
  • Previous by thread: Re: New to AppleScript,please help.
  • Next by thread: Re: Slow vs faster
  • Index(es):
    • Date
    • Thread