开发者

How to check whether application is launched by user or NSWorkspace

开发者 https://www.devze.com 2023-03-02 01:27 出处:网络
I have one Cocoa application and one launch agent. Launch agent launches application using launchAppWithBundleIdentifier: method call.

I have one Cocoa application and one launch agent. Launch agent launches application using launchAppWithBundleIdentifier: method call.

Inside my application I want to check application is launched by user(Normal launc开发者_JS百科h) or is it launch agent launching my application.


It seems like you should be able to send an Apple Event via the additionalEventParamDescriptor: parameter of the launchAppWithBundleIdentifier: call and then receive that in your app so you know it's your agent launching you.

0

精彩评论

暂无评论...
验证码 换一张
取 消