Rootless

Automate iOS, iPadOS, and macOS using plain JavaScript. Build custom widgets and interact directly with native APIs.

Download on the App Store
Rootless app interface

Plain JavaScript

Supports ES6. Scripts are stored as plain .js files on your disk.

Native APIs & Documentation

Integrate directly with iOS native APIs. Fully documented, available offline.

Siri Shortcuts

Trigger scripts via Siri. Present tables, websites, and custom HTML natively.

System Integration

Run from the Share Sheet, process inputs, and manage local files via Files.app.

x-callback-url

Communicate seamlessly and trigger workflows with other apps on your device.

Customizable & Ready

Tailor the code editor to your liking. Includes several example scripts to start immediately.

Documentation

Also inside the app, or as rootless.json.

require

One script using another

Loads another script from your library and returns its exports. A module is an ordinary script, so it stays editable, runnable and previewable. It runs in the same context and sees the same globals and bridges. A module that throws while loading stops the run, and the error names the module and the line inside it.

Methods

require(name)Any

Loads another script from your library and returns what it exported. The module sets module.exports; names are matched case-insensitively against script titles. Requiring the same module twice gives the same object, so state is shared. Cycles and chains deeper than 8 are refused with a message naming the path.

  • name String required

    The other script's title, matched without regard to case or surrounding spaces.

returns Whatever the module assigned to module.exports.

Examples

A shared helper

// In a script titled "Helpers"
function greet(name) {
  return "Hello, " + name;
}

module.exports = { greet: greet };

// In any other script
var helpers = require("Helpers");

Script.setWidget(new Widget({
  child: Text(helpers.greet("world")),
}));