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.

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

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
add comment

1 Answer

up vote 1 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 Twitter.app (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
add comment

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.