如何从终端隐藏应用程序?

And*_*rew 1 terminal macos

在 OS X 中从终端打开应用程序很简单:open -a Twitter.app.

是否有一些特殊的终端命令可以隐藏打开的应用程序(本质上相当于从应用程序内部输入?+ H)?

klo*_*car 5

像这样的事情是一个非常艰难的开始。

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

这是一个稍微好一点的例子

on run argv

    set programName to item 1 of argv

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

end run
Run Code Online (Sandbox Code Playgroud)

你与运行osascript ~/hider.scpt Twitter作为一个例子假设它在你的家目录的名称hider.scpt,你要隐藏Twitter.app(你不使用单词“的.app”)。