Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Mar 18, 2008, 11:12 AM   #1
macrumors newbie
Join Date: Mar 2008
Apple Script Help, "do shell command"

Hey all,

After moving to Leopard I have noticed that the Finder, and more importantly Spotlight have completely lost their usefulness to me. As a new sys admin I loved being able to type in some obscure plist I needed to edit into Spotlight and have show right up. But that was in Tiger and this is Leopard, now when I type in anything I get Safari History items, and really random txt files that I really had no idea existed.

So instead I have been using terminal to do my dirty work. Using the
"find / | grep -i variable" command.

I would like to build a little Applescript that ran that command, but with the variable be something I type into a dialog box. And then just have it spit the results out.

I know this might end up requiring more then just Applescript, possible Xcode, but who knows.

Ohsnaptakethat is offline   0 Reply With Quote
Old Mar 18, 2008, 11:30 AM   #2
macrumors regular
Join Date: Mar 2007
I am not in front of my mac, but IIRC you could try something like this:
property theCommand : ""

repeat while theCommand is ""
   display dialog "Enter the value to search for:" default answer theCommand
   set theCommand to text returned of result
end repeat

   do shell script "find / | grep -i  " & quoted form of theCommand
on error errorMsg number errorNum
   display alert "Error " & errorNum message errorMsg buttons "Cancel" default button 1
end try
Also check out Automator. There is a lot of cool stuff you can do, including having it prompt you for variables to insert into the commands to follow.
macfaninpdx is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
File renaming apple script help jelloshotsrule Mac Programming 0 Jun 11, 2008 09:18 AM
Apple Script Help! File Compression thriftinkid Mac Programming 0 Mar 24, 2008 11:35 AM
Need Basic Apple Script Help gumby777 Mac Programming 2 Oct 16, 2007 09:00 PM
Apple Script Help!! blackangel Mac Programming 10 Sep 29, 2007 06:29 PM
Apple Script Help! damson34 General Mac Discussion 0 Oct 5, 2002 03:49 PM

All times are GMT -5. The time now is 12:35 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC