-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open a file from Finder/Explorer #1830
Comments
Thanks for opening this! I was certain there was a ticket for it already but this is great! I've got code for this on Mac but will need to look into what's available on Windows and Linux. If you have any information on that, please feel free to add it to the ticket. I've scheduled it in for v2.1 👍 |
Thanks! Sorry, I don't have any info regarding win/lin. I primarily use mac for GUI-related stuff. |
On linux I think there is two ways to do this, one of which needs root permission. (I'm no expert, this is how I use it.) By "hand" This registers the app for the current user only!
By xdg-mime
Edit: |
@lyimmi This thread looks a bit inactive. Is someone working on this? If not, I would like to pick this up. |
@sriramr98 hi, feel free to pick this up. |
macOS specific: I was able to edit the <key>NSHumanReadableCopyright</key><string>{{.Info.Copyright}}</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>deb</string>
+ </array>
+ </dict>
+ </array>
</dict></plist> And this works - I can double-click on a See https://apple.stackexchange.com/questions/370427/what-does-macos-actually-do-when-open-a-file To allow a macOS Wails app to handle opening a file from Finder it would need to handle these messages. |
I'm leaving below some links I found under a brief search that might shed a light for when developing for Windows:
|
Is your feature request related to a problem? Please describe.
No response
Describe the solution you'd like
From the native OS Finder/Explorer the user can open a file in the a wails app. On mac this might mean using the right-click menu and selecting "Open with..." and then a wails app.
If the wails app is registered as the default handler for a specific file type, simply double-clicking on a file from Finder/Explorer should open it in the wails app.
Electron has some prior art here, although an ideal solution for wails/go might look different: https://www.electronjs.org/docs/latest/api/app#event-open-file-macos
Describe alternatives you've considered
No alternatives known other than using something besides Wails.
Additional context
There's also a related discussion: #1829
Wails is currently great for putting a UI on top of a web app or some Go functionality, however, its capabilities would be significantly expanded (IMO) if Wails apps could handle files the same way native apps do. Certain use-cases likely will not be possible otherwise.
The text was updated successfully, but these errors were encountered: