Slow vs faster
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