• 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: do shell scripting a "Find"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell scripting a "Find"


  • Subject: Re: do shell scripting a "Find"
  • From: Gnarlodious <email@hidden>
  • Date: Fri, 25 Feb 2005 10:55:47 -0700

Title: Re: do shell scripting a "Find"
Entity M Ranes spoke thus:

> I am wanting to find files and applications using shell & applescript. Nothing
> is working, is there anyone who can show me a working method, post a snippet
> to start from, or just some tidbit to work with.  I am trying to FIND an
> application or file whose name contains "TheName" and return a path,
> completely in the background?  Please help.

property fileExt : ".html"

set theClipboard to the clipboard
if
theClipboard is {} then set theClipboard to (current date) as text
tell
me to display dialog "Search for string (case sensitive):" default answer {theClipboard}
set forString to the text returned of the result
set
inFolder to choose folder
tell
me to display dialog "What kind of file:" default answer fileExt
set fileExt to the text returned of the result

set cmd to "find " & POSIX path of inFolder & " -type f -name '*" & fileExt & "' | xargs grep '" & forString & "'"

set the clipboard to (do shell script cmd)
tell me to display dialog "The results are on the clipboard"


-- Gnarlie's Applescript page:
http://Gnarlodious.com/Apple/AppleScript/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >do shell scripting a "Find" (From: "M Ranes" <email@hidden>)

  • Prev by Date: Re: set comment for a directory.
  • Next by Date: Re: do shell scripting a "Find"
  • Previous by thread: do shell scripting a "Find"
  • Next by thread: Re: do shell scripting a "Find"
  • Index(es):
    • Date
    • Thread