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

Finder and "open with" #490

Open
hasii2011 opened this issue May 14, 2023 · 1 comment
Open

Finder and "open with" #490

hasii2011 opened this issue May 14, 2023 · 1 comment

Comments

@hasii2011
Copy link

I am having the same problem trying to figure out what this guy on stack overflow asks:

https://stackoverflow.com/questions/73145905/how-to-receive-file-when-file-is-opened-in-python

Looked through Apple's plist documentation did not find any keys to help.

@ronaldoussoren
Copy link
Owner

I've posted an answer to that question, which is close to impossible to answer there due to lack of information.

In short, opening files in macOS by double clicking or dropping a file on the application icon results in a file open event (AppleEvents) that the application needs to handle. Most GUI libraries have a way convert those events into their regular event handling code.

You appear to be using wxWidgets, and that has some documentation on how to do this: https://wiki.wxwidgets.org/WxMac-specific_topics#File_associations. That package is targeting C++ code, but I expect that something similar can be done in Python code.

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

No branches or pull requests

2 participants