Re: do shell scripting a "Find"
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