• 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
How to speed up execution time of this script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to speed up execution time of this script


  • Subject: How to speed up execution time of this script
  • From: Bert Groeneveld <email@hidden>
  • Date: Mon, 9 Aug 2010 14:10:40 +0200

-- Hope that someone can help speeding up the execution time of the following (part of) my script
-- The execution time is acceptable as long as there are no more than let's say 500 pictures in the the_ImagePath_folder
-- Unfortunately, the fact is that I have more than 10000 pictures inside the_ImagePath_folder
-- What I want to achieve is getting a list of only those filenames (inside the_ImagePath_folder) that start with a given article number

-- This is what I have right now and executes much much much too slow:
tell application "Finder"
set the_ImagePath_folder to alias "Macintosh HD:Applescript:Giving:SpreadTool:HiRes_Images local:" -- a folder that contains 10000 images
set all_the_Hires_Images to name of every file of the_ImagePath_folder --max 20 secs execution time if the_ImagePath_folder contains 10000 images (this is very acceptable since I run this part of the script only once.)
end tell

-- Now the time consuming part for which I badly need help:
set articleNumber to "6615"
set foundImageNames to {}
repeat with Image_Name in my all_the_Hires_Images
if Image_Name starts with articleNumber then
set foundImageNames to foundImageNames & Image_Name
end if
end repeat

-- Hope someone can help or give tips on how to speed up the last part of this script.
-- Bert.
 _______________________________________________
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: How to speed up execution time of this script
      • From: CYB <email@hidden>
    • Re: How to speed up execution time of this script
      • From: "Mark J. Reed" <email@hidden>
    • Re: How to speed up execution time of this script
      • From: "email@hidden" <email@hidden>
    • Re: How to speed up execution time of this script
      • From: KOENIG Yvan <email@hidden>
  • Prev by Date: Re: Libraries and effiency
  • Next by Date: Re: Libraries and effiency
  • Previous by thread: Calendars
  • Next by thread: Re: How to speed up execution time of this script
  • Index(es):
    • Date
    • Thread