Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.