• 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: Finding Filenames that contain a certain string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding Filenames that contain a certain string


  • Subject: Re: Finding Filenames that contain a certain string
  • From: "Stockly, Ed" <email@hidden>
  • Date: Thu, 12 Jul 2007 10:53:03 -0700
  • Thread-topic: Finding Filenames that contain a certain string

Title: Re: Finding Filenames that contain a certain string
set myFolder to choose folder
tell application "Finder"
    set fileList to {"l325010a", "l325010b", "l325010c", "l325010d", "l325010e"}
    set allFoundFiles to {}
    repeat with thisFileName in fileList
        try
            set foundFiles to (every file of myFolder whose name begins with thisFileName)
            if the class of foundFiles is not list then
                set the end of allFoundFiles to foundFiles
            else
                set allFoundFiles to allFoundFiles & foundFiles
            end if
        end try
         end repeat
    return allFoundFiles
end tell


>>> I've got 'set fileNameList to paragraphs of (do shell script

No need for a shell script here. Plain vanilla appleScript works just fine, and may even be faster.


 
> Just to clarify I want to search through a directory and find files  
> that start with l325010a, l325010b, l325010c, l325010d, l325010e, etc  
> all the way to z. Is there a bit more synatx I need. I've searched on  
> the web, but got no clues.

HTH,

ES
 _______________________________________________
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: Finding Filenames that contain a certain string
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: Re: Persistent data storage
  • Next by Date: Re: InDesign CS2: Problem with launching scripts out of the script window
  • Previous by thread: Re: Finding Filenames that contain a certain string
  • Next by thread: Re: Finding Filenames that contain a certain string
  • Index(es):
    • Date
    • Thread