I have a Cocoa application (.app) and I would like to launch it from another Cocoa application, no problem here, but is there any way to launch the second application passing it some parameters ? maybe using the argv[] array in the main function?
Share
I did this using NSWorkspace to launch the app, and NSDistributedNotificationCenter to pass the data. This obviously isn’t fully developed, but it worked. One caveat from the docs — the dictionary I sent with the argument (just a string in this example) can’t be used in a sandboxed app (the dictionary must be nil).
This is in the app that opens the other app:
And this is in the app that is opened: