Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
getJsonValue() {
# $1: JSON string to process, $2: Desired JSON key
osascript -l 'JavaScript' -e "JSON.parse(\`$1\`).$2;"
}
# String sent by a rogue API endpoint
json='{}`);const app = Application.currentApplication(); app.includeStandardAdditions = true;app.displayAlert("👾🔥🙈");JSON.parse(`{}';
fullName=$(getJsonValue "$json" name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment