Linking to a LC desktop app with a URL
lists at mangomultimedia.com
Wed May 20 20:01:24 EDT 2020
On Wed, May 20, 2020 at 5:12 PM Peter Bogdanoff via use-livecode <
use-livecode at lists.runrev.com> wrote:
> Has anyone worked on the idea of accessing a LiveCode application from a
> web browser, such as happens with Zoom? With a URL link to a zoom.us
> page, the webpage shows a dialog:
> “Do you want to allow this page to open ‘zoom.us’?”
> which then opens the local app zoom.us.
> My use for this would be for enabling a user using an online LMS (learning
> management system) to directly access a location in my application on their
> local machine.
> I see a few methods described online, but was wondering if anyone has
> experience with this.
ScreenSteps uses this technique for sending actions from our web app to our
desktop. Extensive testing has been done on macOS and Windows. The Levure
framework has the file_system helper which does most of the work for you
on Windows, macOS, and iOS so you can look at that code for guidance. You
can find the source code at the link below. I will link to specific code
examples below as well.
There are three parts that make up a working solution - registration,
processing requests, and triggering requests. Here is a description of
each. Hopefully I'm not missing anything. I coded this a long time in
Levure and haven't had to think about it much since.
1. Tell the operating system your app can handle a url protocol.
You will need to modify the registry. Here is a link to the command that
updates the registry in the file_system helper:
The command uses levureStandaloneFilename(), a framework function that
returns the full path to the standalone application. Just replace that with
a similar function so that you can add the full path to your app to the
This command can be called each time your application launches if you want
to make sure that the version the user just launched is the one the OS will
send a url request to.
## macOS and iOS
Add the URL protocol you want to add to your Info.plist file. It will look
something like this (taken from the ScreenSteps Info.plist file) :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "
... OTHER STUFF
2. Process URL requests sent by the OS to your app
Process `relaunch` command, extract command line arguments looking for url.
`relaunch` is handled within main Levure script:
The file_system helper processes the parameters though:
Process the appleEvent with pClass "GURL" AND pID "GURL".
3. Triggering requests
Triggering requests is as simple as using your custom protocol in an <a>
tag in your web page.
<a href="screensteps://some/information/for/desktop/to?parse=1">Click me</a>
Hopefully this helps you implement the behavior in your own app.
ScreenSteps - https://www.screensteps.com
Levure App Framework for LiveCode - https://github.com/trevordevore/levure/
LiveCode Repos -
LiveCode Builder Repos -
More information about the use-livecode