We recently updated our AppleScript/JXA APIs! This means increased and improved macOS application programmatic access to Windows, Tabs, and Spaces within Arc.

While we’ve included a few examples of things that you can now do with the new API below, you can also find the full docs as a Dictionary via the Script Editor app on any Mac:

Screen Shot 2023-01-13 at 10.33.07.png

CleanShot 2023-01-13 at 09.18.59@2x.png

CleanShot 2023-01-13 at 09.19.13@2x.png

<aside> 🔹 For feedback or questions you can always find us by hitting CMD T > Feedback or send us a note on members.arc.net! We can’t wait to see what you’ll build.

</aside>

Windows

Querying for open windows

tell application "Arc"
	get the title of every window
	get the properties of front window

	tell front window
    /* do something */
  end tell
end tell

You can use the every window, front window, and window <number> commands to query for windows.

Opening a new window

tell application "Arc"
	make new window -- creates a new window
	make new window with properties {incognito:true} -- creates a new incognito window
end tell

To open a new window, you can run the make new window command in the application scope.

Opening a URL in Little Arc

tell application "Arc"
	make new tab with properties {URL:"<https://arc.net>"}
end tell

To open a new Little Arc window, you can run the make new tab command in the application scope.

Spaces

Querying for spaces

tell application "Arc"
	tell front window
		get the properties of every space

		tell space 2
		  /* do something */
    end tell
	end tell
end tell