• 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: Very slow AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

-- 
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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: Very slow AppleScript
      • From: Christopher Stone <email@hidden>
References: 
 >Re: Very slow AppleScript (From: "emile.a.schwarz" <email@hidden>)

  • Prev by Date: Re: Very slow AppleScript
  • Next by Date: Re: Very slow AppleScript
  • Previous by thread: Re: Very slow AppleScript
  • Next by thread: Re: Very slow AppleScript
  • Index(es):
    • Date
    • Thread