Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

It's trivial to open applications from the terminal in OS X: open -a

Is there some special terminal command that will hide an open application (essentially the equivalent of typing +H from inside the application)?

share|improve this question
up vote 2 down vote accepted

Something like this is a pretty rough start.

osascript -e 'tell application "Finder"' -e 'set visible of process "Twitter" to false' -e 'end tell'

Here is a slightly better example

on run argv

    set programName to item 1 of argv

    tell application "Finder"
        set visible of process programName to false
    end tell

end run

Which you run with osascript ~/hider.scpt Twitter as an example assuming it's in your home dir with the name hider.scpt and you want to hide (you don't use the word '.app').

share|improve this answer
Thanks! That works perfectly! Unfortunate that it has to be done with AppleScript, but oh well… – Andrew Aug 5 '12 at 22:11
I believe there are wrappers for other languages to the AppleScript API; Python for one. – Erik Allik Dec 23 '15 at 15:21

Your Answer


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.