• 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 Files containing a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding Files containing a string


  • Subject: Re: Finding Files containing a string
  • From: "Mark J. Reed" <email@hidden>
  • Date: Mon, 9 Jul 2007 06:52:45 -0400

A more general shellscript solution is to use the find command to traverse the filesystem starting at a given folder, since it will include subfolders etc.

set fileList to every paragraph of (do shell script "find " & (quoted form of POSIX path of startFolder) & " -type f -print0 | xargs -0 grep -l 'I325010[a-z]'")

repeat with posixPath in fileList
    set theFile to (POSIX file posixPath)
    -- do stuff with theFile here
end repeat
 _______________________________________________
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 Files containing a string
      • From: Rob Stott <email@hidden>
References: 
 >Finding Files containing a string (From: David Bradley <email@hidden>)
 >Re: Finding Files containing a string (From: Rob Stott <email@hidden>)

  • Prev by Date: Re: Finding Files containing a string
  • Next by Date: Re: Finding Files containing a string
  • Previous by thread: Re: Finding Files containing a string
  • Next by thread: Re: Finding Files containing a string
  • Index(es):
    • Date
    • Thread