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

Open with → Choose another app function not working #1212

Open
jerrygreen opened this issue Feb 27, 2024 · 5 comments
Open

Open with → Choose another app function not working #1212

jerrygreen opened this issue Feb 27, 2024 · 5 comments

Comments

@jerrygreen
Copy link

In windows, there's an ability to choose an app as default for opening files:

image

Currently if you try to do this, what you get is this error:

image

/neutralino.config.json file is missing or corrupted.

Describe the solution you'd like
To have some ability to open files using «Open with», with Neutralino apps.

Describe alternatives you've considered
Electron :\

@Sadaf-A
Copy link
Contributor

Sadaf-A commented Mar 3, 2024

@jerrygreen Hey, I just tested this on windows 11 and it is working as expected I hope you are talking about the os.showOpenDialog() method. Which windows version are you using?

@jerrygreen
Copy link
Author

jerrygreen commented Mar 3, 2024

Urgh, it’s not exactly my use-case you’re describing. Here, I’m not using os.showOpenDialog()

If I understand correctly from what I read from the docs, os.showOpenDialog() is meant to use to open files internally – from within the app.

What I describing here, is when user opens the file from the system, then the system calls the program, i.e. program initiated externally.

Say, I have .md files, and I want assign this extension to my little program, which is markdown viewer. So when I double-click a markdown file from finder/nautilus/explorer – my program is automatically started by system, and the program opens corresponding file immediately. That’s just an example.

In my use-case, I wanted to make a program to preview 3D model, which I did and it’s working, but I don’t know how to assign .gltf extension to my program as a default program opening this kind of files – when I do assign the extension to my program, this error occurs while opening the file.

Basically, it’s a bit different use-case than os.showOpenDialog()

It seems it’s not possible to do with Neutralino currently, but I might be mistaken. I haven't found an example in docs. It seems like I need some kind of event listener for this.

My specs:

OS: Windows 10 x64 (22H2)
Neutralinojs version: v5.0.0
Neutralinojs client library version: v5.0.0
Neutralinojs CLI version: v11.0.0

@jerrygreen
Copy link
Author

On another glance into the docs, I think I might have found the thing, actually. It might be this:

Not gonna check it for the time rn, to know whether it works from external call or not, since I'm onto other projects already.

Might be useful for others if they come by from google, though. Seems like it's exactly the thing I needed.

@Ayush-sss
Copy link

I want to work on this issue. @jerrygreen Please assign me this issue. I will try my best to fix this bug.

@OrigamingWasTaken
Copy link

Urgh, it’s not exactly my use-case you’re describing. Here, I’m not using os.showOpenDialog()

If I understand correctly from what I read from the docs, os.showOpenDialog() is meant to use to open files internally – from within the app.

What I describing here, is when user opens the file from the system, then the system calls the program, i.e. program initiated externally.

Say, I have .md files, and I want assign this extension to my little program, which is markdown viewer. So when I double-click a markdown file from finder/nautilus/explorer – my program is automatically started by system, and the program opens corresponding file immediately. That’s just an example.

In my use-case, I wanted to make a program to preview 3D model, which I did and it’s working, but I don’t know how to assign .gltf extension to my program as a default program opening this kind of files – when I do assign the extension to my program, this error occurs while opening the file.

Basically, it’s a bit different use-case than os.showOpenDialog()

It seems it’s not possible to do with Neutralino currently, but I might be mistaken. I haven't found an example in docs. It seems like I need some kind of event listener for this.

My specs:

OS: Windows 10 x64 (22H2)
Neutralinojs version: v5.0.0
Neutralinojs client library version: v5.0.0
Neutralinojs CLI version: v11.0.0

I had actually the same problem (on macos) and my temporary fix was to create within the app, some sort of URL-Scheme handler that would get launched and receive the file, then forward them to the main neutralino app. This handler can be made in powershell, etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants