How to open files without using default App in Electron? - windows

I know Electron's API openPath to open file by default app. For example, png file will be opened by Photos application if I set Photos as my default app to open png file in Windows.
But my goal is to let user chooses different apps to open file instead of default app every time.
This function is similar to open with when you right click the file and then choose another app to open it in Windows.
"open with" screenshot
So, is there any way to achieve my goal by using Electron'S API or any workaround?

Related

Open Microsoft Edge while running app in Hololens

I want to open Microsoft Edge while running an app with the HoloLens. In my particular case, I'm developing a simple 2D app in Unity, where the idea is to press a button and open a pdf file, image, etc. Currently I've managed to open these files with the WWW class by pressing a button, but everytime I do it the app gets closed...
Is it possible achieve it? what would I need to implement in order to do it?
Thanks in advance!
To open EDGE or the default web browser you can use Application.OpenURL
https://docs.unity3d.com/ScriptReference/Application.OpenURL.html
In any case your app will go to the background, In case you need to show a website inside your app you will need to use any Plugin/Asset like this one https://github.com/gree/unity-webview that sadly doesn't support Windows.

Force an application to open as split view in Windows 8+

I have an application that allows the user to read different contents (pdf, images), in the local application, on Windows 8 and +.
But I need my application to stay open on the side while the user is looking at the content (so he can come back easily). I used LauncherOptions.DesiredRemainingView, which works well if the user is using Reader app (or equivalent) for reading PDFs.
However, if he uses Adobe for example, it will not work, and my app will be hidden, while Adobe reader is displayed windowed on the desktop.
Is there a mean to either :
- force Adobe to open in split mode (using the DesiredRemainingView value)
- or, force the user to open the content with a given app (which would be Reader instead of Adobe) ?
Thanks in advance,
You cannot force any size - the Desired prefix is intended to make it clear that this is something the app wants, but isn't guaranteed to be given.
You can try and get the PDF file to open in a specific reader app if you use the LauncherOptions -- in Windows 8.1, you can specify a preference for an app to install if the user doesn't currently have an app via PreferredApplicationPacakgeFamilyName. Starting in Windows 10 you can force a specific launch using TargetApplicationPackageFamilyName.

How can I run multiple copies of the same app using Google ARC Welder?

I've installed the ARC Welder extension for Chrome. I opened it and added an apk. When I navigate to my Chrome Apps page, I see an icon of the app, and when I click on it, it launches ARC Welder and starts that app. Beautiful!
When I try to open a second copy of the app, it closes my Chrome Apps tab and sets the focus to the already-running instance of that app.
On the Chrome Apps page, I've tried right-clicking the icon to look for some option, holding control and clicking it, and opening it from a different Chrome window, but each time, it either does nothing or just directs me to the already-running instance of the app.
Is it possible to use Google ARC Welder to run multiple copies of the same app?
Thanks!
ARC Apps only allow one instance at a time. If you click the App icon it only refocuses the window.
It would be problematic if multiple App instances could be running simultaneously; for instance, they would share the same filesystem which was not necessarily designed to be accessed simultaneously like this.
If you want a second app instance at the same time, you would need to package it separately with a second App ID.
after loading it in ARC Welder
this can be done in 4 steps
click download zip instead of test.
After you save the zip file you'll have to extract it to a folder.
Then in chrome go to the extension page and select "developer mode".
finally click "load unpacked extension" and select the folder you just extracted
if you want to run multiple instances of the same app
you can simply make an copy of the folder you extracted en repeat step 4
Docker will allow you to run multiple ARC Welder containers simultaneously. Here is a Youtube clip showing how.

Launching other applications in Windows phone 7 Programatically

I am downloading a file from Internet, and I am saving this in IsolatedStorage. and Now I want to Open that file, ie if it is excel we should open a file with excel if excel is installed, or otherwise prompt the user to choose the application to open that file as like in PC windows os, How can we do this.. give me some Idea..
As general rule, there is no way to do what you are describing. The exception to this is for media, for which you can integrate with the Music and Video hub. This would allow you to, for instance, download a movie and then play it in the same way as if it was part of the zune collection, even though it's in IsolatedStorage.
If you want to download office files from the internet you can simply link to them directly by opening them in a WebBrowserTask. The user would then be able to open the file in the relevant office program. So, if you did the follwoing, the file would be opened in Excel:
var wbt = new WebBrowserTask();
wbt.URL = "http://example.com/file.xlsx";
wbt.Show();
This would not allow you to store the file in IsolatedStorage and that may or may not be an issue for you.
Windows Phone applications run in isolation and with very few exceptions cannot interact with other programs. So there's not a way for you to present a program chooser to allow the user to choose another application to launch.
I am pretty sure there are system launchers for different applications. For example, the YouTube application can be launched programatically the way I showed here - basically it is similar to the way Matt showed. Ultimately, each app is launched via a UIX reference (catched here), but there is no public endpoint to open a res URL.

Mail Message Link Handling

I have written an AppleScript which when supplied with a Windows network link, will convert it to the correct smb:// equivalent for the server in our office, mount the network drive, and open the requested folder in Finder.
I have this built in an application which just takes a pasted network path. Ideally I need this to trigger on clicking a link in a Mail.app email message so that it can check if the link is in the correct format, and if so run the script and attempt to mount the drive and load the folder in Finder.
How would I go about doing this?
In order to do this I think you'd need to create a Cocoa application that was registered with OS X Launch Services as the default role handler for smb:// links.
I've written some stuff about how to do this on another question: How do you set your Cocoa application as the default web browser?
If there's a pure AppleScript solution or a way of only handling links within Mail.app I'm not aware of it.

Resources