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.

Distance

Metres, kilometres, miles. One value

A length, shaped like Duration: build one in any unit and read it back in another. formatted() goes through Format, so it prints the unit the reader's region uses.

Properties

inMetersNumber

The distance in metres.

inKilometersNumber

The distance in kilometres.

inMilesNumber

The distance in miles.

inFeetNumber

The distance in feet.

Methods

.formatted(options?)String

Localised text for this distance.

  • options Any
    • to String

      Convert to this unit. Left out, the region decides.

    • style String

      short, medium or long.

    • digits Number

      Maximum decimal places.

Distance.meters(value)RootlessDistance

A distance in metres.

  • value Number required
Distance.kilometers(value)RootlessDistance

A distance in kilometres.

  • value Number required
Distance.miles(value)RootlessDistance

A distance in miles.

  • value Number required
Distance.feet(value)RootlessDistance

A distance in feet.

  • value Number required

Examples

Showing a distance

var d = Location.current().distanceTo(home);
Text(d.formatted());        // "4.2 km" or "2.6 mi"
Text(String(Math.round(d.inMeters)) + " m");