私はアプリケーション 'myApp'を持っており、ログイン時に 'myApp'を読み込むように設定しています。 私はこれがすべてのlaunchd経由で罰金実行している:launchdを実行してアプリケーションを非表示にする
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.myAppDomain.myApp</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/myApp.app/Contents/MacOS/myApp</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
私はまた、ユーザーが、私はbashスクリプトを作成し、ProgramArgumentsアレイに追加しようとしたにも「て、myApp」
を非表示にするオプションを提供したいと思います
#!/bin/sh
osascript=/usr/bin/osascript
$osascript -e 'tell application "System Events" to set visible of process "'myApp'" to false'
exit 0
しかし、これは実行に失敗するか、アプリが起動する前に実行される可能性が高くなります。
私は単に見落としているこれを行う簡単な方法はありますか?ありがとうございます。