Skip to Content
IntegrationsApple Script

Apple Script

You can see the documentation of OK JSON’s Apple Script support in the Script Editor app of macOS.

Exported Objects

  • Application.scripts

Supported Commands

run

tell application id "net.shinystone.OKJSON" set firstScript to first item of scripts run firstScript end tell

Both run and run script accept an optional with parameter for the script’s input. If no input is given, OK JSON passes the pasteboard content as the input instead.

tell application id "net.shinystone.OKJSON" run first item of scripts with "{\"hello\":\"world\"}" end tell

run script

tell application id "net.shinystone.OKJSON" run script "script-file-name-without-js-extension" end tell

view from pasteboard

tell application id "net.shinystone.OKJSON" view from pasteboard end tell

view

tell application id "net.shinystone.OKJSON" view "{\"hello\":\"world\"}" end tell

view from URL

tell application id "net.shinystone.OKJSON" view from URL "https://formulae.brew.sh/api/formula/jq.json" end tell

The URL needs to start with http or https.

show Scripts Panel

tell application id "net.shinystone.OKJSON" show Scripts Panel end tell

show History

tell application id "net.shinystone.OKJSON" show History end tell

reload scripts

tell application id "net.shinystone.OKJSON" reload scripts end tell

run cURL command

tell application id "net.shinystone.OKJSON" run cURL command "curl -X GET \"https://httpbin.org/get\" -H \"accept: application/json\"" end tell