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

Re: How to speed up execution time of this script


  • Subject: Re: How to speed up execution time of this script
  • From: Bert Groeneveld <email@hidden>
  • Date: Fri, 13 Aug 2010 23:30:24 +0200

Earlier this week I posted that Mark's solution (see shell script below) executed in 20 seconds. Well, I was misled by a Mac that must have been very tired. Sorry for that uncareful reply.
I tried on 4 other Macs. 3 of them indeed executed the shell script in less than a second, and one Mac almost realtime.
I executed the script on a folder containing 15000 images.
This shines of course a new light on my case.

I'm just a grapgic designer that took a step or two in the world of scripting, so I'm not to clever with that "do shell script thing".
What I am wondering right now is if it is possible to write fast-executing shell scripts that are equivalent to the following Finder scripts (the_ImagePath_folder contains 10000+ images):

set all_the_Hires_Images to name of every file of entire contents of the_ImagePath_folder whose name begins with articleNumber

set all_the_Hires_Images to name of every file of entire contents of the_ImagePath_folder whose name contains ("." & articleNumber)

Note: I also need the names of the files in all the subfolders (entire contents).

Bert.

On 9 aug 2010, at 19:28, Mark J. Reed wrote:

On Mon, Aug 9, 2010 at 8:10 AM, Bert Groeneveld
<email@hidden> wrote:
set all_the_Hires_Images to name of every file of the_ImagePath_folder

Why not filter it at this point... as I see Ed has suggested:

set foundImageNames to every file of the_ImagePath_folder whose name
begins with articleNumber

But you can probably do much better with the shell:

set foundImageNames to paragraphs of (do shell script "cd " & quoted
form of posix path of the_ImagePath_folder & " && ls -1 " &
articleNumber & "*")

Note that all the solutions so far will, for instance,  find "654" if
you ask for "65".  If there's any sort of delimiter between the
article number and the rest of the filename, you should include that
at the end of the pattern you search for.

--
Mark J. Reed <email@hidden>



 _______________________________________________
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: "Mark J. Reed" <email@hidden>
References: 
 >How to speed up execution time of this script (From: Bert Groeneveld <email@hidden>)
 >Re: How to speed up execution time of this script (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: What's in an iCal url?
  • Next by Date: Re: symlinks
  • Previous by thread: Re: How to speed up execution time of this script
  • Next by thread: Re: How to speed up execution time of this script
  • Index(es):
    • Date
    • Thread