Launchlet Guide

This document is a work-in-progress. Feel free to ask questions tagged with launchlet on Super User or Stack Overflow.

Recipes: A Thinking Tutorial

A Recipe is a format for expressing how functions will run in Launchlet.

Command

A Command is the simplest kind of Recipe. It has a Name and Callback:

Name
Say Hello
Callback
alert('Hello')

This can be run by Launchlet directly as it has no input.

Procedure

A Procedure has a Signature and Callback, and optionally Arguments:

Signature
Greet
Arguments
message
Callback
alert(message)

This can be called from any other Recipe using the API this.api['Greet'] or this.api.Greet. In this way, the previous example could be changed to:

Name
Say Hello
Callback
this.api.Greet('Hello')

Pipe mode: Subject

A Subject has a Name, Output Type and Callback:

Name
Salutation
Output Type
String
Callback
return 'Yo'

In Pipe mode, this can be used as input for any Action that takes a String.

Pipe mode: Action

An Action has a Name, Input Types and Callback:

Name
Shout
Input Types
String
Arguments
message
Callback
alert(message.toUppercase())

In Pipe mode, this can be used on any Subject that returns a String. Although a Recipe can have multiple inputs, an Action will generally have only one.


Safety

Running arbitrary JavaScript can be dangerous, and this project comes with no guarantees of safety from malicious code, but there are a few things that the composer will try to flag and ignore:

Anyone with security expertise and ideas on how to improve safety in the project is welcome to add a [GitHub Issue].

It is best to run code that is concise and easy to read.


Recipes from the current page

Optionally, Launchlet can include Recipes from any page that sets LCHPageRecipes on the window object to an Array. This allows pages to expose their functionality in a way that is accessible to 3rd parties:

window.LCHPageRecipes = [{
 LCHRecipeName: "Say Hello",
 LCHRecipeCallback: function () {
  alert('Hello');
 }
}];

For example, when running Launchlet on rosano.ca, it is possible to choose a 'Send a message' Command that originates from the page.


What is remoteStorage?

remoteStorage is an incredible open-source technology for synchronizing data between multiple devices and making it available offline.

It allows the same data to be used in different ways by multiple apps. You could think of it as a USB key for your documents that you can plug into websites to work on your stuff.

If you don't have one, it also works with Dropbox and Google Drive. You can also get one for free from 5apps.