Frayo
All guides

Guide / Command line and AI

URL scheme and automation

Frayo registers the frayo:// link scheme. Opening a link starts an action, so a script, a launcher or a mouse button can drive the app. This page lists every link. The command-line tool is the better choice when you need the capture back; see the last section.

From Terminal:

open "frayo://capture-area"
open "frayo://capture-area?rect=0,0,400,300"

If Frayo is not running, macOS starts it and then delivers the link. Quote the link in a shell, because ? and & mean something to it.

Any tool that can open a URL works the same way: the Shortcuts app and other launchers. Frayo also has its own actions in the Shortcuts app for the main captures and the Library, which need no link.

Routes#

Every action in Shortcuts has a link, named after the action in lower-case words joined by hyphens. Extra routes follow the table.

LinkWhat it doesNeeds the switch
frayo://capture-areaOpens the area pickerNo
frayo://capture-previous-areaCaptures the last area again, or opens the picker if it is goneNo
frayo://capture-windowOpens the window pickerNo
frayo://capture-fullscreenCaptures the full screenNo
frayo://self-timerOpens the picker, then counts down and capturesNo
frayo://scrolling-captureOpens the picker for a scrolling captureNo
frayo://capture-textOpens the picker and copies the text in the areaNo
frayo://record-screenStarts a recording, or stops the one in progressYes, always
frayo://quick-searchOpens Quick SearchNo
frayo://scan-q-rOpens the picker and scans a QR codeNo
frayo://open-from-clipboardShows the image on the clipboard as a thumbnailNo
frayo://open-settingsOpens SettingsNo
frayo://libraryOpens the LibraryNo

The route for QR scanning is scan-q-r, because each capital letter in the action name becomes a hyphen and a lower-case letter. An unknown route makes the Mac beep and does nothing.

The capture, Quick Search and Library routes are subject to the trial and the licence, like the same action from the menu. After the trial, only full-screen capture stays free among them; the clipboard and Settings routes are not gated. See Trial and license.

Parameters#

A link can carry a rectangle, which skips the picker. Only three routes read it.

ParameterRoutesMeaning
rect=x,y,w,hcapture-area, capture-text, record-screenThe region, in screen points, measured from the top-left of the main display
seconds=nrecord-screen (with rect)Stop the recording after n seconds

Limits the app enforces:

  • rect needs exactly four numbers. w and h must be greater than 0 and at most 20000. Every number must be finite and no larger than 100000 in size.
  • The rectangle must overlap a connected display.
  • seconds must be from 1 to 600. Any other value is ignored, and the recording runs until you stop it.
  • A bad rect is ignored: the app falls back to the normal picker for that route.
  • A rectangle capture is skipped while the picker or a countdown is on screen, so it never photographs itself.
  • On other routes rect has no effect on what happens, but it still counts as a capture link for the switch below.

Examples:

open "frayo://capture-area?rect=0,0,1200,800"
open "frayo://capture-text?rect=0,800,1200,300"
open "frayo://record-screen?rect=100,100,800,600&seconds=10"

The switch#

Two kinds of link need Allow scripts and agents to capture in Settings › Integrations:

  • frayo://record-screen, with or without parameters.
  • Any link with a rect= parameter, on any route.

With the switch off, Frayo shows the notice "Allow scripts in Settings › Integrations first." and does nothing. Links that open a picker or a window (the rest of the table) always work.

Security model#

A web page can try to open any frayo:// link. A link that opens a picker is harmless, since you still choose what to capture. The links that capture or record without a picker would be silent, so they stay locked until you turn the switch on yourself. With it off, a page cannot start a capture or a recording. With it on, trust the pages and tools that run as you.

Use the command line instead#

Use the command-line tool when you need an answer back. A link is one-way: it starts an action and returns nothing. The tool prints the file path and the text, searches your Library, and returns an exit code. It is also the only way to read text from an image file. It follows the same switch.

You wantUse
Start a capture from a button, launcher or shortcutA link
Record a region for a fixed timerecord-screen with rect and seconds
The file path, the text, or a search result in a scriptfrayo capture, frayo ocr, frayo search