Developers

Shortcuts, AppleScript and arx:// links

Open pages in a space or profile, open Little Arx, switch spaces, list and show tabs from the Shortcuts app, AppleScript, Raycast and other apps.

This page is a first draft. It may change before the public beta.

Arx works with the Shortcuts app and with anything that can open a link, such as Raycast, Alfred, Keyboard Maestro or open in Terminal.

Shortcuts actions

Search for Arx in the Shortcuts app. Its actions show Arx's icon:

ActionWhat it does
Open Page in ArxOpens a web page. Choose a Space or a Profile, or neither to let Air Traffic Control decide.
Open Little ArxOpens a Little Arx window, with a page if you give one, in the space you choose.
Switch Arx SpaceShows a space in the main window and brings Arx forward.
Get Current Arx PageGives the address of the page in Arx's front window, and its title. A private window gives nothing.

Arx has to be running for an action to work. A headless run doesn't take actions.

LinkWhat it does
arx://open?url=<page>Opens the page where Air Traffic Control sends it.
arx://open?url=<page>&space=<space>Opens it in that space.
arx://open?url=<page>&profile=<profile>Opens it in that profile's most recent space.
arx://open?url=<page>&little=1Opens it in Little Arx.
arx://littleOpens an empty Little Arx; add url= and space= as above.
arx://space?name=<space>Switches the main window to that space.

A space or profile is its name, ignoring case, or its ID. When a web page opens one of these links, Arx asks first, on that page's window, and says what the link would do; links from other apps, Shortcuts and AppleScript don't ask. A private window's page can't use them. Percent-encode the page: open "arx://open?url=https%3A%2F%2Fexample.com&space=Work". Only web pages (http and https) open. If the space or profile isn't there, nothing happens. Arx's own arx:// pages, such as chats and diagnostics, don't open from other apps, and a headless run ignores these links.

AppleScript

Arx has a scripting dictionary: open it in Script Editor with File → Open Dictionary… → Arx. It lists Arx's browser windows (front first), spaces, profiles and tabs (title, URL, space, profile, pinned, active), and has these commands:

  • open page "https://example.com" in space "Work", or in profile "Personal", or in little arx true
  • switch space "Work"
  • show tab, reload tab and close tab for a tab. Closing puts a tab in the Tab Archive; pinned tabs and Favorites stay.
tell application "Arx"
  set inbox to first tab whose URL contains "mail.google.com"
  show tab inbox
end tell

Private windows and their tabs aren't listed. The first time an app scripts Arx, macOS asks whether to allow it.

Run JavaScript

execute runs JavaScript in a tab as the body of an async function and gives back what it returns, as JSON text:

tell application "Arx" to execute (first tab whose active is true) javascript "return document.title"

It's off unless you turn on developer mode and Allow JavaScript from AppleScript in Settings → Developer. When it's off, the script gets an error saying so. Private windows' tabs never run it, and neither does a headless run. A script has 10 seconds and a 256 KB result.

Planned
A Raycast extension with Search Tabs, Open in Space and New Little Arx, built on the dictionary and arx:// links. It isn't in the Raycast Store yet.