Re: Finding Filenames that contain a certain string
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