Note that there are some explanatory texts on larger screens.

plurals
  1. POKnow if MainApp is launched by HelperApp
    primarykey
    data
    text
    <p>I am really stuck here with a simple task, but still cannot get it working.</p> <p>I've managed to implement 'LaunchAtLogin' feature with the HelperApp as described in <a href="http://blog.timschroeder.net/2012/07/03/the-launch-at-login-sandbox-project/" rel="nofollow">this article</a>. But my application should react differently on <strong>launch-by-helper-app</strong> and <strong>launch-by-user</strong> actions. So my task now is to have some kind of flag indicating that MainApp was launched by HelperApp.</p> <p>I know there are many similar questions, but still none of the solutions works for me. Sandbox seems to cut all the parameters I am trying to send to the MainApp.</p> <p>Here what I have tried:</p> <pre><code>- [NSWorkspace - launchApplicationAtURL: options: configuration: error:] - [NSWorkspace - openURLs: withAppBundleIdentifier: options: additionalEventParamDescriptor: launchIdentifiers:] - LSOpenApplication() </code></pre> <p>Until recently I thought I can rely on <strong>-psn</strong> argument sent by Finder when user manually launches the application. But this argument is sent on 10.8 even when MainApp is launched by HelperApp.</p> <p>In the <a href="http://blog.timschroeder.net/2012/07/03/the-launch-at-login-sandbox-project/" rel="nofollow">article</a> mentioned above, author suggests using <code>[NSWorkspace - launchApplicationAtURL: options: configuration: error:]</code>. Parameters are sent, but nothing arrives to the MainApp.</p> <p>Has anyone succeeded to accomplish this (or similar) task?</p> <p>Need help! Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload