This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |