I have a Cocoa Document-Based Application (text editor) and I want to be able to interact with it from the command line.
For example, I would like to install it as an editor for entering git / svn commit messages on the command line.
Assuming I'm creating a command line tool using Foundation, what is the best way for my command line tool to interact with the GUI?
Obviously, I can use standard open events so that my application opens a specific file, but I also need a command line application to wait for the graphical interface to work with the document (the user closes the editor window) before exiting (similar to mate -w file.txt in TextMate command line tool or equivalent in other other text file editors).
TextMate 2 uses a socket file . Is this a better approach? If possible, I would like to use something higher, perhaps the NSDistributedNotificationCenter .
source share