Skip to content

Conversation

@nb
Copy link

@nb nb commented Jun 10, 2022

Opens a file with the default associated app, instead of launching an app. Useful to open files/directories via keyboard shortcuts. My specific use-case was to open my “Downloads” directory.

From developer interface standpoint, having those two methods makes sense, but I am happy to hear any feedback since we are increasing the API surface.

Implementation notes:

  • Since opening an .app file by default launches it, the App.launch() method uses this one internally. Based on the docs, it should work equally well.
  • Since the old code was using the deprecated launchApplicationAtURL, I used its counterpart, openURL. I am super new to Apple APIs, so decided to stick with what works, but I am happy to switch to something that's not deprecated. To be honest, I didn't have time to dig into the trade-offs of the various alternatives, like open.
  • We are losing a bit of fidelity in the error message, though it sounds acceptable to me.

Thank you for the great project :)

If the maintainers think the change makes sense, I am happy to add docs/changelog entry.

  • Updated related documentations
  • Added the change to the Changelog

Opens a file with the default associated app, instead of launching an
app. Useful to open files/directories via keyboard shortcuts.

Since opening an .app file by default launches it, the `App.launch()`
method uses this one internally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants