I'm now trying to Sandbox my document-based application. The application bundles a helper command-line executable in `Application.app/Contents/MacOS/` to let users open their files easier in my application via command-line. So far, to sandbox the application itself has successfully been done. However, when I sandbox the helper command-line executable, or when I bundle the executable to the sandboxed application, files can not be opened in the application any more.
I use the following method to open files via command-line.
- The main application is scriptable.
- command-line executable uses ScriptingBridge to communicate with the main application
- When the command-line executable launched, it creates a SBApplication instance with the main application's bundle identifier, and let it open file URLs that were given via command-line argument.
https://github.com/1024jp/CommandLineBundleSample
Well actually, it seems that this problem is not based on the communication between sandboxed applications but because there is no way to open files passed as command arguments, namely as normal strings.
Question:
So, my question is; Is there any way to open a file of which path was passed as an argument to a Sandboxed command-line application? Or should I give up to bundle the command-line tool and release it out of the Mac App Store separately?
If there is any other way to reach the goal besides ScriptingBridge (e.g. XPC service, Application Group, etc.), it's also welcome to suggest.