Skip to content
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

implement MacOS openFile/openFiles events for file associations #2906

Closed
wants to merge 2 commits into from

Conversation

APshenkin
Copy link
Contributor

@APshenkin APshenkin commented Sep 13, 2023

Description

Implements file association for macOS #1830

MacOs provides two events for cases when single or multiple files are opened.

You can see how it works here.
![Watch the video]

Also important note for documentation is how to specify associated files in Info.plist

        <key>CFBundleDocumentTypes</key>
        <array>
          <dict>
            <key>CFBundleTypeExtensions</key>
            <array>
              <string>wwails</string>
            </array>
            <key>CFBundleTypeName</key>
            <string>Wails Test File</string>
          </dict>
        </array>

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Test repo is available here https://github.com/APshenkin/wails-open-file
PR should be fetched and replace in go.mod should be adjusted

  • Windows
  • macOS
  • Linux

Test Configuration

# Wails
Version  | v2.6.0
Revision | a419721dcdf16da7a4afd92b9ba63b2050229a26
Modified | true

# System
┌─────────────────────────┐
| OS           | MacOS    |
| Version      | 13.5.2   |
| ID           | 22G91    |
| Go Version   | go1.20.2 |
| Platform     | darwin   |
| Architecture | arm64    |
└─────────────────────────┘

# Dependencies
┌─────────────────────────────────────────────────────────────────────────┐
| Dependency                | Package Name | Status    | Version          |
| Xcode command line tools  | N/A          | Installed | 2397             |
| Nodejs                    | N/A          | Installed | 16.15.0          |
| npm                       | N/A          | Installed | 8.19.3           |
| *Xcode                    | N/A          | Installed | 14.3.1 (14E300c) |
| *upx                      | N/A          | Available |                  |
| *nsis                     | N/A          | Available |                  |
└──────────────────────── * - Optional Dependency ────────────────────────┘

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@APshenkin
Copy link
Contributor Author

closed as open version with Windows support together #2918

@APshenkin APshenkin closed this Sep 17, 2023
@APshenkin APshenkin deleted the feature/mac-open-files branch October 23, 2023 10:40
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.

1 participant