Re: Very slow AppleScript
Re: Very slow AppleScript
- Subject: Re: Very slow AppleScript
- From: Shane Stanley <email@hidden>
- Date: Fri, 01 Mar 2013 23:32:50 +1100
On 01/03/2013, at 11:21 PM, emile.a.schwarz <email@hidden> wrote:
Hi,
I removed what my code really does because it is not relevant.
Also not relevant everything excepted the following line:
set ItemToChange to item 1 of SelectedFldr
This line takes 7 seconds by its own. When set in a 22 items loop, it grows to 20 seconds to deals with a file (in the complete script).
You repeatedly asking the Finder to get the first item of the folder. Why not get them all once, and loop through the list:
set SelectedFldr to choose folder default location (fwFldr as alias)
# get the items in the target folder set theItems to items of SelectedFldr
repeat with i from 1 to count of theItems set ItemToChange to item i of theItems # I removed the working code from here end repeat
|
_______________________________________________
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