Finding Selected Files

I started a thread asking how I can find and delete selected files at http://discussions.apple.com/thread.jspa?messageID=6435289#6435289

I was advised to paste the following script into Apple's Script Editor...

tell application "Finder"
delete (every file of entire contents of folder "Sites" of home whose name is "Thumbs.db")
end tell

Unfortunately, it doesn't work. It just times out, my Finder freezes, and I have to manually restart my computer.

However, it does at least FIND every instance of the file I'm looking for. So I'd like to ask about a few variations of this script so I can understand how it works.

Suppose that instead of searching for every instance of Thumbs.db in the folder Sites I wanted to search for every instance of Thumbs.db in User/Sites/MySite. What script would I write to do that? What about searching for the file in User/Sites/MySite/includes ?

Also, what about searching for text on a page rather than a file name? For example, I would like to compile a list of every file in a website that includes a PHP database query. I think I could find all of these queries by searching for mysql_ in each web page's source code. So how could I search for every file that includes "mysql_" in User/Sites/MySite?

Thanks.

MacBook Pro

Posted on Jan 25, 2008 6:12 AM

Reply
1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Finding Selected Files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.