Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wrote a very basic script that launches "bc" in quiet mode very a simple but effective calculator. I want to be able to launch it via Spotlight. I can make it a ".command" file, but it never shows up under "top hits". I've tried turning it into an application via Platypus, but it's not designed for an interactive window. Does anyone have any other thoughts to make this work?

Goal - run bc via spotlight with as few keys as possible.

share|improve this question
up vote 0 down vote accepted

You could save a script like this as an application in AppleScript Editor:

tell application "Terminal"
    do script "clear;printf '\\e[3J';bc -ql"
    activate
end tell

printf '\\e[3J' clears the scrollback.

If you use iTerm, you can create a profile for bc:

Then run an AppleScript like this:

tell application "iTerm" to tell (make new terminal) to launch session "bc"
share|improve this answer
    
This is a perfect solution. One question - when I "quit" BC i am returned to the terminal, is there an option I can pass via AppleScript to quit terminal after BC quits? – Mike C Dec 20 '13 at 19:26
    
Nevermind, I figured it out: do script "clear;printf '\\e[3J';bc -ql;exit" Thanks again – Mike C Dec 20 '13 at 19:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .