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

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 18, 2008, 11:12 AM   #1
Ohsnaptakethat
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 com.apple. 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.



Thanks
Ohsnaptakethat is offline   0 Reply With Quote
Old Mar 18, 2008, 11:30 AM   #2
macfaninpdx
macrumors regular
 
Join Date: Mar 2007
I am not in front of my mac, but IIRC you could try something like this:
Code:
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

try
   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

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
General: iOS7 command line... Equivalent of "say" command? RobertoG Jailbreaks and iOS Hacks 0 Jan 19, 2014 05:05 PM
Apple script batch shell script prramesh Mac Programming 5 Sep 15, 2013 03:35 AM
"Applications" menu command - "item cannot be found" - owner/permissions? (10.6.8) MacOSExustio OS X 2 Jul 20, 2013 05:05 AM
OS X: CS:GO "command" + "left mouse click" causes "right mouse click" Whats wrong? oeppel Mac and PC Games 1 Apr 6, 2013 03:12 AM
iTunes Apple script for additional "View Options"? kumquat Apple TV and Home Theater 14 Jun 29, 2012 09:02 AM

Forum Jump

All times are GMT -5. The time now is 02:20 AM.

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

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