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.

Location

Location and geocoding services

The device's coordinates, plus geocoding, distance and opening a place in Maps. Needs location access: current() asks the first time it runs in the app, and status, isAuthorized and requestAccess() let a script ask first.

Properties

latitudeNumber

Latitude

longitudeNumber

Longitude

altitudeNumber

Altitude

accuracy.horizontalNumber
accuracy.verticalNumber
statusString

"authorized", "denied", "restricted" or "notDetermined".

isAuthorizedBoolean

True when the location can be read.

Methods

.reverseGeocode(locale?)[GeoResult] ›

Reverse geocode this coordinate to get address information.

  • locale String
.formattedAddress(locale?)String

Get a formatted address string for this coordinate.

  • locale String
.distanceTo(other)RootlessDistance

The distance to another coordinate, as a Distance: d.inKilometers, d.inMeters, d.formatted().

  • other Coordinate required
.isWithin(radius, center)Boolean

Whether this coordinate is within a radius of another.

  • radius Distance | number required

    A Distance, or a number of kilometres.

  • center Coordinate required

    The point to measure from.

.bearingTo(other)Number

Bearing in degrees (0-360) to another coordinate.

  • other Coordinate required
.openInMaps(label?)

Open this coordinate in Apple Maps.

  • label String
Location.requestAccess()String

Shows the permission sheet. App only.

returns The status afterwards.

Location.current(options?)Coordinate

Get the current device location.

  • options Any
    • accuracy String

      "best", "nearest10Meters", "hundredMeters", "kilometer" or "threeKilometers". Coarser is faster and uses less battery.

Location.at(latitude, longitude)Coordinate

A coordinate from latitude and longitude, for distances and bearings without asking the device.

  • latitude Number required
  • longitude Number required

Examples

Current location & address

const loc = Location.current({accuracy: "100m"});
const address = loc.formattedAddress();
console.log(address);

Distance calculation

const home = Location.at(40.7128, -74.0060);
const office = Location.at(40.7589, -73.9851);
const km = home.distanceTo(office);
console.log(`${km.toFixed(1)} km away`);