How do I start a desktop application from the browser on a Mac? - macos

I'm building a web application that when finished will need to trigger a desktop app to open and load a specific file (or connect to a URL I'm passing to the desktop app).
I'm having a hard time finding documentation about how to do that on a Mac, can you point me to the right place?

You want to define a custom URL protocol.
Here is an example;
http://weblogs.asp.net/morteza/How-to-run-a-desktop-application-from-a-web-page
Here are some notes about how to do it on a Mac;
https://superuser.com/questions/548119/how-do-i-configure-custom-url-handlers-on-os-x
https://onflapp.wordpress.com/lincastor/

Related

How to wrap web app to windows 10 desktop app?

I have a web application (accessed by clients using standard browser) which is available on custom individual url for each client and I would like to "generate" a "custom desktop application" (probably zip file with some exe file and some xml config file - where exe runs webview with url from xml) which can be installed on clients computer (Windows 10 support only is ok). This application when launched will open frameless window (no menu, no url bar etc) of a custom size with webview opening the defined https url (url will contain secret login hash for user / or session must be kept even after computer restart etc ..). This app should run only online (no offline mode needed).
The goal is to take one simple specific proces (entering simple data) from a complex web application and make this simple process easilly accessible for users (just click icon and enter data, submit to server, close, no login ever needed).
I have no experience developing for Windows 10, but I expect there must be some easy "universal app" solution as probably more developers are solving the same problem. What are the most (time) effective, but standard and safe possibilities?
I found a nice tutorial: https://www.todesktop.com/guides/nativefier. This tool is based on Node.js, which works fine on macOS, Windows, or Linux.
First, install Node.js on your computer. Then, run
npm i nativefier -g
to install nativefier. You can wrap your web app into native app simply by running
nativefier "your-url" --name "Application Name"
You can read the post for further information, like code signing your application, generating native installers, etc.

Open Safari on Mac Client from RDP or Citrix

I have a scenario where I have users accessing our company application either via Citrix or RDP.
The app needs to make a call from within the session to the client pc so it can open a browser for credit card entry.
This is all working okay as I'm using COM to make the call on Windows clients, however I'm not exactly sure how to approach this for Mac.
I believe a start might be able to use AppleScript to open the browser, but not sure on the best way to call the AppleScript. Should I create a C++ app written in xCode.
I'm new to any apple development, so any help or direction would be helpful.
If you have access to the shell on the remote Mac all you need to do to open Safari (or other default browser) is to execute open <URL>, for example:
open http://example.com

Windows Phone - Call default web browser

I am trying to develop Windows Phone App, I would like to know that how can I call the default web browser with a specific URL(e.g. http://www.google.com) when I launch the program?
Thanks
When you're launching "the program" as you say (Internet Explorer) you use the following code:
WebBrowserTask browser = new WebBrowserTask();
browser.URL = new Uri("http://www.google.com", UriKind.Absolute);
browser.Show();
The WebBrowser task is inside the Microsoft.Phone.Tasks namespace, the documentaion of which is here: Microsoft.Phone.Tasks.WebBrowserTask
You should also know that the "default" browser is always Internet Explorer, because right now there is no way for users to define an alternative browser as their "default".
Edit:
After reading your question more closely, I can tell there is a little bit of ambiguity. If you want to launch the browser immediately when your app launches, you should know the following:
This kind of application will fail Microsoft's marketplace validation (check the Application Certification Requirements for Windows Phone
Even if it didn't fail the certification, it would be a kind of strange application... not one that is of very much use to your users.
If, however you intend to launch the phone's browser when the user clicks a button, then the above code I posted will work just like you want it to, just make sure to include this line at the top of the code file that it's in:
using Microsoft.Phone.Tasks;
Hope that helps!

Launch Application in Mac and Windows

I have my application installed on the user's machine(both windows and mac users). Now the user also goes to my web site for certain other things. I want to provide a link in the web site which says "Launch my app". When he clicks on the link, it should launch my application, which has been installed on his system. I was thinking of going the Active X route but it is not recommended + have to use another approach for Mac. The other option was some how get a file association with my application and make it work. Is there any other option ?
You could register your application for special URL schemas, like mygreatapp://open. In the same way that an ftp://... link opens the default FTP app and a mailto://... link opens the default email application, you can register your own app for any custom [myuniqueschemahere]:// schema.
Register your app as a "helper" app for browsers as part of the installer process.
So if you have a link on your website with a URL like "prashant://thisfineapp", clicking on it launches your application.

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