Skip to content

The card file

Actions and steps

What happens when someone taps a button: steps, arguments and results.

An action is a named list of steps. A button’s on, a field’s on_change, a source’s on_change, an inbox’s on_receive, a shortcut or an agent runs it. Steps run in order and the first failure stops the action.

"actions": {
    "kill": {
        "args": {
            "port": "int:1-65535"
        },
        "confirm": "Kill whatever is on port {$args.port}?",
        "steps": [
            {
                "script": "kill-port.sh",
                "args": [
                    "$args.port"
                ]
            },
            {
                "refresh": "ports"
            }
        ]
    }
}

Action keys

stepsRun in order; the first failure stops the action (required)
argsTyped inputs: { "port": "int:1-65535" }
confirmConfirmation text; may use $args. Or { "text": "Unlock the door?", "auth": "biometric" }: Face ID, Touch ID or the passcode instead of a Yes/Cancel question, every run, whoever starts it (no permission; Mac and iPhone)
timeoutSeconds for the whole action (default 120)
runs_onOptional list of platforms (macos, ios) that narrows where the action runs; it can never add one its steps don't run on. Usually left out: validate_app works it out from the steps
jobtrue: a long run the card follows as $job.<action> (status idle|running|done|failed|cancelled, progress 0–1 from each, done, total, started, ended, error); job.cancel stops it; with notify declared, one notification when it ends
exposetrue: Shortcuts, Siri and Spotlight can run it as Run <action> in <card> (Mac and iPhone). Not with args, confirm or a tap-only step (ask, files.pick, photos.pick, camera.take, scan.code, location.get, share, clipboard.read, screen.record.start); on the iPhone not with mic.record.start or shortcuts.run either
Arg typestext, int, int:<min>-<max>, number, bool, enum:<a>|<b>|<c>

Steps may add "as": "name" to keep a result for later steps ($name). One run of an action at a time. While it runs, $running.<action> is true. A drop part's action also gets $args.files (undeclared; never from run_action): the files the user dropped or picked.

Results and arguments

  • A step with "as": "name" keeps its result for the steps after it, as $name.
  • $args.<name> reads an argument. Events fill some without declaring them: $args.value and $args.previous for on_change, $args.event, $args.from and $args.from_id for on_receive, $args.files for a drop zone, $args.item for a swipe or context menu.
  • $running.<action> is true while it runs: use it for disabled on the button.
  • Some steps only run from the person’s own click or tap (the camera, pickers, scanning, location, the share sheet, reading the clipboard, screen recording, asking a question), never from a source, a timer, an inbox or an agent. Their descriptions say so.

Steps

Every step in the catalogue, grouped by what it’s for. The badges say where it runs; a step’s permission must be in the card’s permissions.

Between devices and apps

Keep a card the same on all your devices, and send values and files to your other devices and to other apps, end-to-end encrypted.

send

Mac iPhone permission send:<inbox>

Send a value to this app on the user's other devices. Each copy gets it in its inbox source of that name, with $args.event (the value), $args.from and $args.from_id (the sender's name and id) in on_receive. Step key file: a path to send too (screen.capture's 'as', a camera.take or photos.pick photo or a files.pick file on the iPhone, a file in a folder the user chose, or a received one; ≤ 10 MB; Mac and iPhone): on_receive then also gets $args.file, "received/<name>", for image, gallery and steps (50 newest kept). Step key to: a device id, usually "$args.from_id" to reply to the sender only, or a list of ids ("$picked" from a devices source checklist; empty fails); omit for every device. Step key alert: one line (bindings allowed, cut at 120 characters) a receiving iPhone shows as a notification (even with TailApps closed) and lists in its Inbox; without it the value arrives quietly (fine for a synced count). Alert text isn't end-to-end encrypted: keep secrets out of it. Only works once the user turns on Sync to My Devices for the app (no tool can); never reaches other people. Step key app (§46): another app's id, or "$args.from_app" to reply: to that app's inbox, which must list this app in from_apps. This device only (no sign-in) unless to is "devices" or ids (then sync too). No file

value { inboxName: value }: one of the app's own inbox sources (with app: that app's)
result { delivered: number of other devices reached (0 is fine) }; with sync off, a run from a source, timer or on_receive gets { delivered: 0, skipped: 'sync_off' } and carries on, while a click or run_action fails
{
    "send": {
        "messages": {
            "text": "$args.text"
        }
    },
    "file": "$img",
    "alert": "New message"
}

Web and APIs

Call any HTTPS API, with keys from the Keychain or a provider sign-in.

fetch

Mac iPhone permission net:<host> (also with auth)

HTTP request; keys method, headers, body, auth, raw, parse, select, timeout

value URL
result parsed body (or the raw object)
{
    "fetch": "https://api.example.com/items",
    "as": "items"
}

Example: outgoing webhook

{
    "fetch": "https://hooks.slack.com/services/T000/B000/XXXX",
    "method": "POST",
    "body": {
        "text": "Deploy finished: {$deploys.0.status}"
    },
    "note": "An outgoing webhook (Slack, Discord, …) is a POST fetch; declare net:<host>. If the URL itself is the secret, use a curl script with env connection:<name> instead"
}

open

Mac iPhone permission open:url

Open a web or mail link in the default app (https://, http://, mailto: only)

value URL binding
{
    "open": "https://cloud.laravel.com"
}

Camera, sound and media

Photos, video clips, recordings, codes and text, all from the user’s own tap.

camera.take

Mac iPhone permission camera (a video also mic.record)

Take a photo, or with mode video record a short clip, in the camera sheet (Apple's on iPhone, TailApps' own camera window on a Mac), from the user's own tap only (not a source, timer, inbox, another app or run_action); cancel stops the action quietly. A photo is a JPEG resized to max_px on its long side (default 2048, 512 to 4096), upright. A video is an MP4 (H.264 + AAC) at quality low | medium (default) | high (480p, 720p, 1080p), at most max_seconds long (1 to 600, default 60); sound false drops its sound. Both land in the app's temporary folder (kept 24 hours) with no location or other metadata. A video also needs the mic.record permission. Upload it with files.save to a storage setting, share it, or send it (≤ 10 MB)

value {} or { "camera": "back" | "front", "max_px": 2048 } or { "mode": "video", "max_seconds": 60, "quality": "medium", "sound": true }
result { path, name, base, ext, kind, type, size, modified } (like files.pick); a video adds seconds, width, height
{
    "camera.take": {},
    "as": "photo"
}

Example: video

{
    "camera.take": {
        "mode": "video",
        "max_seconds": 30
    },
    "as": "clip"
}

photos.pick

iPhone

Choose photos from the iPhone's library in the system's own photo picker (no library permission: TailApps sees only what the user picks), from the user's own tap only (not a source, timer, inbox, another app or run_action); cancel stops the action quietly. Each photo is a JPEG in the app's temporary folder, resized to max_px on its long side (default 4096, 512 to 8192), upright, with no location or other metadata. iPhone only; on a Mac the button shows Needs iPhone (use files.pick with accept image there). Send it to the Mac with send's file (keep max_px at 4096 or less there: a bigger JPEG can pass send's 10 MB), or upload it with files.save

value {} or { "multiple": true, "max": 10, "max_px": 4096 }
result { path, name, base, ext, kind, type, size, modified } (like camera.take), or a list of them with multiple
{
    "photos.pick": {},
    "as": "photo"
}

scan.code

Mac iPhone permission camera

Scan a QR code or barcode with the camera, live, from a tap

value {} or { "types": ["qr", "ean13"] } (qr, ean13, ean8, upce, code128, code39, code93, itf14, itf, pdf417, aztec, datamatrix, codabar, gs1databar; default every type)
result { type, value }
notes iPhone: a camera sheet; Mac: a camera window. The first code of one of the types comes back; Cancel stops the action. Only from the person's own tap, never a source, timer, inbox or agent. For a code in a photo or file use vision.codes
{
    "scan.code": {
        "types": [
            "qr"
        ]
    },
    "as": "code"
}

mic.record.start

Mac iPhone permission mic.record

Start recording the microphone (one recording per app at a time). A red indicator shows on the card and in the Mac's menu bar until mic.record.stop. It stops by itself after max_seconds (default 300, at most 3600); mic.record.stop still returns what was recorded. On iPhone it only starts from a tap on a button, never from a source. For hold-to-talk, give a global shortcut on_release (see 'shortcuts')

value {} or { "max_seconds": 120 }
{
    "mic.record.start": {
        "max_seconds": 120
    }
}

mic.record.stop

Mac iPhone permission mic.record

Stop this app's recording and save it as an .m4a in its temporary folder (kept 24 hours: copy it with files.save to keep it). Fails if nothing is recording

value {}
result { path, seconds, at (start time, unix seconds) }
{
    "mic.record.stop": {},
    "as": "rec"
}

speech.transcribe

Mac iPhone permission speech.transcribe

Turn speech in an audio file into text, on this device (nothing is sent anywhere; needs macOS 26 or iOS 26; the first use of a language downloads its model). Step key language: a code like "en-GB" or "pl" (default: the device's language)

value audio file path: usually "$rec.path" from mic.record.stop (on the Mac also a file in a folder the user chose, or one received)
result { text, segments: [{ start, end, text }] } (seconds)
{
    "speech.transcribe": "$rec.path",
    "language": "en-GB",
    "as": "heard"
}

vision.ocr

Mac iPhone permission vision.ocr

Read text from an image, on this device

value image binding (a file the app may read: a capture, a photo it took or picked, a dropped or received file)
result text
{
    "vision.ocr": "$img",
    "as": "text"
}

vision.codes

Mac iPhone permission vision.ocr

Find QR codes and barcodes in an image, on this device

value image binding, like vision.ocr
result [{ type: qr | ean13 | ean8 | upce | code128 | code39 | code93 | itf14 | itf | pdf417 | aztec | datamatrix | codabar | gs1databar | other, value }], top to bottom; [] when there are none
{
    "vision.codes": "$img",
    "as": "codes"
}

share

Mac iPhone permission share

Open the system share sheet (AirDrop, Messages, Mail, Save Video…) from the user's own tap only. file: a path a step may read (a camera.take or mic.record.stop result, a clipboard.read image, a picked or received file); url: an https link; text: a line to go with them. The user picks where it goes

value { "file": "$clip.path" } or { "url": "$saved.url", "text": "…" }
result { done } (false when the sheet was closed without sharing)
{
    "share": {
        "file": "$img"
    }
}

image.compose

Mac iPhone

Put a picture (a path like screen.capture's "$img", or a file object like camera.take's "$photo") on a background (a hue, a gradient of 2–4 hues, or a picture such as one of the app's assets/, blurred 0–1) with padding, rounded corners and a shadow, at an aspect ratio. Makes a new file in the temporary folder (kept 24 hours); the original isn't touched. For nicer screenshots, social cards, a photo with a frame

value { "image": path, "background": { "hue" } | { "gradient": [hues], "angle": degrees (default 135) } | { "image": path, "blur": 0–1 }, "padding": none|s|m|l|xl (default m), "corners": none|s|m|l (default m), "shadow": bool, "aspect": auto|1:1|4:3|16:9|9:16, "format": png|jpg, "max_px": 512–8192 }
result { path, name, ext, kind, type, size, modified }
{
    "image.compose": {
        "image": "$img",
        "background": {
            "gradient": [
                "purple",
                "orange"
            ]
        },
        "padding": "l",
        "shadow": true
    },
    "as": "nice"
}

canvas.clear

Mac iPhone

Clear a canvas: its saved drawing is deleted and its state key empties. Run it in the step that gives the canvas a new picture

value the canvas's id, written out
{
    "canvas.clear": "markup"
}

Screen and desktop

Screenshots, screen recordings, displays, windows and the desktop picture.

screen.capture

Mac permission screen.capture

Screenshot; region is the interactive picker

value { "mode": "region" | "window" | "screen" }
result image (temp file path)
{
    "screen.capture": {
        "mode": "region"
    },
    "as": "img"
}

screen.record.start

Mac permission screen.record (sound also mic.record)

Start recording the screen to an MP4 (one screen recording on the Mac at a time), from the user's own click only (not a source, timer, inbox, another app or run_action), except that with the screen.record.remote permission too, a send that just came from one of the user's other signed-in devices may start it (in an inbox's on_receive) with target display or a displays/windows id. target: pick (default: Apple's picker, the user picks a display or window) | display (the main one) | area (the user drags a rectangle; Esc cancels) | an id from the displays or windows source. sound: true (the default microphone, needs mic.record) | false (default) | a microphone id from the audio source; system_audio: bool (what the Mac plays); cursor: bool (default true); quality: medium (default: up to 1080p, 30 fps) | high (native size, 60 fps); max_seconds: default 300, at most 3600. TailApps' own windows are left out. The red item in the menu bar shows it and can stop it; that stop keeps the file for the next screen.record.stop. Cancelling the picker or area stops the action quietly

value {} or { "target": "pick", "sound": true, "system_audio": true }
{
    "screen.record.start": {
        "target": "pick",
        "sound": true
    }
}

screen.record.stop

Mac permission screen.record

Stop this app's screen recording and return it: an MP4 in its temporary folder (kept 24 hours: upload it with files.save or share it). Any run may stop. With nothing recording, it returns the newest recording stopped another way (the menu bar, max_seconds, the app turned off, TailApps quitting) with stopped_by: menu | limit | off | quit, once; with none, it fails

value {}
result { path, name, ext, kind, size, …, seconds, at (start time, unix seconds), width, height, stopped_by? }
{
    "screen.record.stop": {},
    "as": "rec"
}

wallpaper.set

Mac permission wallpaper.control

Set the desktop picture, on every screen or one

value a path ("$args.item.path"), a picked file ("$picked"), or { "image": …, "screen": "all" | "main" | "<screen name>" | a displays source id (bind its id, not its name), "fit": "fill" | "fit" | "stretch" | "center" } (defaults all, fill)
result { before, after }: each a list of { screen, picture (file name), fit }
notes The picture is one the app may read: a capture, a dropped or picked file, a received one, or one in a folder the user chose (bind it). TailApps keeps its own copy, so a capture can be the wallpaper. macOS sets it for each screen's current Space. Screen names come from the error when one doesn't match. The card's ⋯ menu offers Undo
{
    "wallpaper.set": {
        "image": "$img",
        "screen": "all",
        "fit": "fill"
    }
}

Clipboard and files

Read and write the clipboard, take files in, save files out, and tidy a folder.

clipboard.read

Mac iPhone permission clipboard.read

Read the clipboard now, from the user's own click, tap or shortcut only. iOS may ask to allow the paste. image is a PNG in the app's temporary folder (a day) that vision.ocr, clipboard.write, files.save, send and share can use (text wins when both are there: ask for ["image"] to OCR a picture); copied files (Mac) become readable like dropped ones. A password manager's copy gives kind hidden. To follow every copy on the Mac, use a clipboard source

value {} or a list from ["text", "image", "files"] (files: Mac only)
result { change, kind (files | text | image | empty | hidden), text, image, files ([{ path, name, … }]), from, at, truncated (text over 100,000 characters) }
{
    "clipboard.read": [
        "text",
        "image"
    ],
    "as": "copied"
}

clipboard.write

Mac iPhone permission clipboard.write

Copy text or an image

value { "text": … } or { "image": … }
{
    "clipboard.write": {
        "text": "$lastText"
    }
}

files.pick

Mac iPhone

The system's file picker, from the user's own click only (not a source, timer or run_action); cancel stops the action quietly. No permission: the pick is the approval. On iPhone the files are copies in the app's temporary folder

value {} or { "accept": ["pdf"], "multiple": true, "max": 20, "max_mb": 50, "prompt": "Merge" } (accept as on a drop part)
result one { path, name, base, ext, kind, type, size, modified }, or a list of them with multiple
{
    "files.pick": {
        "accept": [
            "pdf"
        ],
        "multiple": true,
        "prompt": "Merge"
    },
    "as": "picked"
}

files.save

Mac iPhone permission files.write:<setting>

Save data into a folder or storage setting; name is a plain file name (no /, .., ~ or leading .); never overwrites (name 2.png, …). On iPhone only to a storage setting set to a bucket (its allow must include s3; a folder setting keeps the app off the phone). Step key expires: seconds a bucket's presigned link lasts (default and max 604800)

value { "data": …, "to": "$settings.<folder or storage>", "name": … }
result saved path (folder setting), or { kind: folder | s3, path, key, url } (storage setting)
{
    "files.save": {
        "data": "$img",
        "to": "$settings.folder",
        "name": "shot-{$now}.png"
    },
    "as": "path"
}

files.list

Mac permission files.read:<setting> (files.write:<setting> covers it)

The files directly in a chosen folder (no subfolders or hidden files), A–Z, at most 1000; shaped like dropped files

value "$settings.<folder setting>"
result [{ path, name, base, ext, kind, type, size, modified }]
{
    "files.list": "$settings.folder",
    "as": "files"
}

files.info

Mac iPhone

One file's details: a capture, a dropped, picked or received file, or one in a chosen folder

value a path
result { path, name, base, ext, kind, type, size, modified }
{
    "files.info": "$args.text",
    "as": "info"
}

files.rename

Mac permission files.write:<the folder's setting>

Rename a file in a chosen folder; it keeps its extension, and a clash gets " 2"

value { "file": path, "name": text }
result the file's new { path, name, … }
{
    "files.rename": {
        "file": "$args.text",
        "name": "Invoice {$now}"
    },
    "as": "renamed"
}

files.move

Mac permission files.write:<setting>

Move a file between chosen folders, keeping its name (a clash gets " 2"); files.write for both

value { "file": path, "to": "$settings.<folder setting>" }
result the file's new { path, name, … }
{
    "files.move": {
        "file": "$args.text",
        "to": "$settings.folder"
    },
    "as": "moved"
}

Notifications and feedback

Alerts now or at a set time, even when TailApps isn’t running, and sounds, haptics and spoken text.

notify

Mac iPhone permission notify

Show a notification; with 'at', at that time even if TailApps isn't running (an alarm). 'id' names it; { "cancel": id } takes it back

value text, or { "title": …, "body": …, "at": time (optional), "id": text (with at) }, or { "cancel": id }
{
    "notify": {
        "title": "Laravel Cloud",
        "body": "Deploy finished"
    }
}

Example: at

[
    {
        "notify": {
            "title": "$args.name",
            "body": "Time's up",
            "at": "$now | add:$args.left",
            "id": "$args.id"
        }
    },
    {
        "notify": {
            "cancel": "$args.id"
        }
    }
]

sound

Mac iPhone

Play a system sound: done, alert, error, tap or pop (the iPhone's silent switch mutes it). At most one a second per app

value name or binding
{
    "sound": "done"
}

haptic

Mac iPhone

A tap the person feels: success, warning, error, light, medium, heavy or selection. iPhone: only while TailApps is open (from a tap, a timer, or an inbox while open); Mac: a haptic trackpad in use, best effort

value kind or binding
{
    "haptic": "success"
}

speak

Mac iPhone permission speak

Read text out loud on this device (first 500 characters; a new line replaces one still being read). At most one a second per app. On the iPhone only while TailApps is open: use notify for a locked phone

value text, or { "text": …, "voice": "en-GB" (language), "rate": 0.5–2 (1 = normal) }
{
    "speak": "Build finished"
}

toast

Mac iPhone

A short note at the bottom of the card for 3 s (6 s with Undo): "Copied", "Deleted". Undo is a button on it that runs an action. Only for the person's own tap or click; a run nobody is watching (a source, timer, inbox, another device or an agent) skips it and goes on

value text, or { "text": "Deleted", "undo": "<action>", "args": { … } } (text at most 120 characters)
{
    "toast": "Copied {$args.text}"
}

Example: undo

{
    "toast": {
        "text": "Deleted {$args.item.title}",
        "undo": "restore",
        "args": {
            "item": "$args.item"
        }
    }
}

Calendar, Reminders and Shortcuts

Show the day’s events, add and tick off reminders, and run the user’s own Shortcuts.

reminders.add

Mac iPhone permission reminders.write

Add a reminder; works inside each

value { "title": text (required), "notes": text, "due": unix seconds, ISO 8601 text, a binding or null, "list": a list's name (default the user's default list) }
result the new reminder's id
{
    "reminders.add": {
        "title": "$args.text",
        "list": "Groceries"
    },
    "as": "added"
}

reminders.done

Mac iPhone permission reminders.write

Tick one reminder off ("done": false opens it again)

value { "id": a reminder's id, "done": true (default) }
{
    "reminders.done": {
        "id": "$args.item.id"
    }
}

shortcuts.run

Mac iPhone permission shortcuts.run:<name>

Run the person's own Shortcut by its name (literal, one permission per Shortcut). Mac: the shortcuts command, its text output comes back; keys input (text in), timeout (default 120, max 600). iPhone: opens it in Shortcuts from a tap only, nothing comes back

value the Shortcut's name
result Mac: its text output, or null; iPhone: null
{
    "shortcuts.run": "Arrive home",
    "input": "$args.text",
    "as": "out"
}

On-device AI

Apple Intelligence and translation, with nothing leaving the device.

ai.generate

Mac iPhone permission ai.generate

Ask this device's own AI model (Apple Intelligence; nothing leaves the device). Prompt up to 8 KB, one run per app at a time. Fails with ai_unavailable where Apple Intelligence is off or missing

value a prompt (text), or { "prompt": …, "shape": arg type names, an object of them or a list of one }
result text, or JSON in the shape
{
    "ai.generate": {
        "prompt": "Summarise: {$args.text}",
        "shape": {
            "summary": "text",
            "todos": [
                "text"
            ]
        }
    },
    "as": "out"
}

translate

Mac iPhone permission translate

Translate text on this device. The language pair must be downloaded (Settings), else it fails with translate_unavailable

value text; "to": a language code (required), "from": a code or "auto" (default)
result the translated text
{
    "translate": "$args.text",
    "to": "fr",
    "as": "fr"
}

This device

Where it is, what it is, keeping it awake, and whether the user is at it.

location.get

Mac iPhone permission location

Where this device is, once, from a tap

value {} or { "accuracy": "best" | "city" }
result { lat, lng, accuracy (metres), altitude (metres or null), at (unix seconds) }
notes Asks for location access the first time (while using only; never in the background). accuracy city rounds to about a kilometre and drops altitude. Only from the person's own tap, never a source, timer, inbox or agent. Show it on a map part, or send it to another device
{
    "location.get": {
        "accuracy": "best"
    },
    "as": "here"
}

awake.start

Mac iPhone permission power.control

Keep this device awake until awake.stop

value {} or { "display": true, "minutes": 60 }
notes Mac: an IOPMAssertion (display: true keeps the screen on too, else only the Mac). iPhone: the screen stays on while TailApps is in front. Ends by itself after minutes (1–1440), when the app is turned off or removed, or TailApps quits. Starting again replaces the last one. Keep your own state (set awake: true) to show it on the card
{
    "awake.start": {
        "display": true,
        "minutes": 60
    }
}

awake.stop

Mac iPhone permission power.control

Let the device sleep again (ends this app's awake.start)

value {}
{
    "awake.stop": {}
}

Commands and scripts

Run the tools you already use, never through a shell.

cli

Mac permission cli:<binary> <first args…>

Run a CLI; keys args, cwd, env, parse, select, timeout

value binary name
result parsed output
{
    "cli": "cloud",
    "args": [
        "deploy",
        "--json"
    ],
    "cwd": "$settings.project",
    "timeout": 600
}

script

Mac permission script:<name>

Run a script from 'scripts'; same keys as cli

value script name
result parsed output
{
    "script": "kill-port.sh",
    "args": [
        "$args.port"
    ]
}

System controls

Read and change sound, Wi-Fi, Bluetooth, power and more on the Mac; network and battery on the iPhone too.

audio.volume.set

Mac permission audio.control

Set the output volume: 0–100 or { "by": -10 }

value a level 0–100 (number or binding), or { "by": 10 } (negative turns it down)
result { before, after }
notes Mute stays as it is (unmute with audio.mute false). The card's ⋯ menu offers Undo for volume, mute, devices and Wi-Fi power
{
    "audio.volume.set": 30
}

audio.mute

Mac permission audio.control

Mute or unmute the sound output

value true (mute), false (unmute) or "toggle" (or a binding)
result { before, after }
{
    "audio.mute": "toggle"
}

audio.input.mute

Mac permission audio.control

Mute or unmute the microphone in use

value true (mute), false or "toggle"
result { before, after }
notes For every app, where the device allows it
{
    "audio.input.mute": true
}

audio.output.set

Mac permission audio.control

Switch the sound output to a device, by name or id

value device name or id (text or binding)
result { before: { id, name }, after: { id, name } }
notes Names and ids come from a { "system": "audio" } source's outputs; alert sounds follow. When none matches it fails with the names it knows
{
    "audio.output.set": "AirPods Pro",
    "as": "switched"
}

audio.input.set

Mac permission audio.control

Switch the microphone to a device, by name or id

value device name or id
result { before, after }
notes Names and ids come from the audio source's inputs
{
    "audio.input.set": "MacBook Pro Microphone"
}

wifi.power

Mac permission wifi.control

Turn Wi-Fi on or off

value true, false or "toggle"
result { before, after }
{
    "wifi.power": "toggle"
}

wifi.join

Mac permission wifi.control

Join a Wi-Fi network this Mac knows

value network name (text or binding)
result { before, after } (network names; before is null without Location)
notes macOS keeps the password of networks it has joined. Join a new secured network once in System Settings first: TailApps never holds Wi-Fi passwords
{
    "wifi.join": "Office"
}

bluetooth.connect

Mac permission bluetooth.control

Connect a paired Bluetooth device

value device name or address (text or binding)
result { before, after }: each { device, connected }
notes By name or address from a { "system": "bluetooth" } source. No pairing or scanning: pair it in System Settings first
{
    "bluetooth.connect": "AirPods Pro"
}

bluetooth.disconnect

Mac permission bluetooth.control

Disconnect a paired Bluetooth device

value device name or address
result { before, after }
{
    "bluetooth.disconnect": "AirPods Pro"
}

display.sleep

Mac permission power.control

Turn the display off now

value {}
notes The Mac stays awake
{
    "display.sleep": {}
}

Screens, questions and batches

Detail screens, a quick question, and long work over a list that the card follows.

open_card

Mac iPhone

Show another card of this app over the current one, with a Back button: a detail screen. The card declares "params" and reads them as $params.<name>; args gives every one. Wherever the app's card shows (menu, pop-out, Dashboard, iPhone) it shows the opened card until Back, close_card or a tab switch; at most 5 deep. Only for the person's own tap or click; any other run skips it

value card id, with "args": { "<param>": value }
{
    "open_card": "detail",
    "args": {
        "id": "$args.text"
    }
}

close_card

Mac iPhone

Go back from a card open_card showed (as Back does), e.g. after Save or Delete on a detail card. Nothing when the view's own card shows. Only for the person's own tap or click

value true
{
    "close_card": true
}

pop_out

Mac

Open this app's pop-out window (its views.floating card, e.g. a round camera bubble), close it, or toggle it. Only for the person's own tap, click or switch; any other run skips it

value true | false | "toggle", or a binding (e.g. a switch's value)
{
    "pop_out": "toggle"
}

ask

Mac iPhone

Ask the person one question in the system's own dialog and keep the answer: type text or a number, or pick from choices. Cancel stops the action quietly (not an error). Only from the person's own tap, click or shortcut: someone has to be there to answer

value { "title": "Rename", "message": text, "input": "text" | "number", "default": text } or { "title": "Move to", "choices": ["Inbox", "Done"] (2–20, or a list binding) }
result the text typed, the number, or the choice picked
{
    "ask": {
        "title": "Rename",
        "input": "text",
        "default": "$args.text"
    },
    "as": "name"
}

each

Mac iPhone

Run do once per item of a list, with $item and $index. A failed item goes in failed and the rest go on; a refused permission or the timeout stops it. max: default 200, at most 1000. No ask, pickers, camera, share or second each inside

value list binding, with "do": [steps]
result { done, failed: [{ index, error }], skipped }
{
    "each": "$shots",
    "do": [
        {
            "files.move": {
                "file": "$item",
                "to": "$settings.folder"
            }
        }
    ],
    "max": 50,
    "as": "moved"
}

job.cancel

Mac iPhone

Stop one of this app's running jobs (an action with "job": true); nothing when it isn't running

value a job action's name
{
    "job.cancel": "convert"
}

State and logic

The building blocks every action uses.

set

Mac iPhone

Write state keys

value { key: value, … }
{
    "set": {
        "lastText": "$text"
    }
}

push

Mac iPhone

Add to a list: the front by default (newest first), or the end with "at": "end" (oldest first); 'max' keeps the newest N either way

value { listKey: value }
{
    "push": {
        "shots": "$path"
    },
    "max": 24
}

increment

Mac iPhone

Add to number state keys (negative counts down; a key that isn't a number yet starts at 0). 'min' and 'max' keep the result in range. A minus before a binding takes its number away: { "set": { "left": "$ends_at" } } then { "increment": { "left": "-$now" } } is the time left, with no script. For counters, scores and timers; send the new value with a send step to keep copies on other devices in step

value { numberKey: amount, … }: a number, a binding, or "-$binding" to subtract
{
    "increment": {
        "count": -1
    },
    "min": 0
}

Example: subtract

[
    {
        "set": {
            "left": "$ends_at"
        }
    },
    {
        "increment": {
            "left": "-$now"
        },
        "min": 0
    }
]

remove

Mac iPhone

Take items out of a list: every item equal to 'match' (or whose fields equal its fields), or the one 'at' a position (-1 = last)

value { listKey: { match: value or { field: value } } or { at: position } }
{
    "remove": {
        "cities": {
            "match": {
                "tz": "$args.tz"
            }
        }
    }
}

update

Mac iPhone

Change items in a list: set these fields on every item equal to 'match' (or whose fields equal its fields), or the one 'at' a position (-1 = last). For ticking a to-do, renaming or editing a note

value { listKey: { match: value or { field: value } (or at: position), set: { field: value } } }
{
    "update": {
        "shots": {
            "match": {
                "id": "$args.text"
            },
            "set": {
                "done": true
            }
        }
    }
}

move

Mac iPhone

Reorder a list: take the first item equal to 'match' (or whose fields equal its fields), or the one 'at' a position, and move it 'by' places (-1 = up one) or 'to' a position (0 = first, -1 = last). It stays inside the list; nothing to move leaves it as it is

value { listKey: { match: value or { field: value } (or at: position), by: places (or to: position) } }
{
    "move": {
        "cities": {
            "match": {
                "tz": "$args.tz"
            },
            "by": -1
        }
    }
}

refresh

Mac iPhone

Run a source now

value source name
{
    "refresh": "deploys"
}

if

Mac iPhone

Branch on a binding's truthiness

value binding
{
    "if": "$health | map:{bad:true, else:false}",
    "then": [
        {
            "notify": "Site is down"
        }
    ],
    "else": []
}