Implement Document Handling for macOS
abhillman opened this issue · 0 comments
On macOS, users can open a document with a desired application by "dropping it" on top of the icon for an Application bundle in the dock1:
Unfortunately, however, when a document is passed to an application, it is not provided in argv
. Here is a simple repository that demos the issue https://github.com/abhillman/macos-argv.
Footnotes
-
It turns out there are actually several ways you can open a document, but they all go through the same code path: (1) dropping a document on an application bundle in a folder, (2) dropping an document on a dock icon for an application bundle, (3) control-clicking on a document and open it with a desired application bundle, (4) running
open -a <path/to/bundle.app> <document>
in a shell ↩