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 tellBoth 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 tellrun script
tell application id "net.shinystone.OKJSON"
run script "script-file-name-without-js-extension"
end tellview from pasteboard
tell application id "net.shinystone.OKJSON"
view from pasteboard
end tellview
tell application id "net.shinystone.OKJSON"
view "{\"hello\":\"world\"}"
end tellview from URL
tell application id "net.shinystone.OKJSON"
view from URL "https://formulae.brew.sh/api/formula/jq.json"
end tellThe URL needs to start with http or https.
show Scripts Panel
tell application id "net.shinystone.OKJSON"
show Scripts Panel
end tellshow History
tell application id "net.shinystone.OKJSON"
show History
end tellreload scripts
tell application id "net.shinystone.OKJSON"
reload scripts
end tellrun cURL command
tell application id "net.shinystone.OKJSON"
run cURL command "curl -X GET \"https://httpbin.org/get\" -H \"accept: application/json\""
end tell