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
#!/usr/bin/osascript | |
on convertListToString(theList, theDelimiter) | |
set AppleScript's text item delimiters to theDelimiter | |
set theString to theList as string | |
set AppleScript's text item delimiters to "" | |
return theString | |
end convertListToString | |
on get_participants() |
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
MY_JSON='[{"name": "Banana", "type": "Fruit"},{"name": "Carrot", "type": "Vegetable"},{"name": "Intentionally Blank Type", "type": ""},{"name": "Bread", "type": "Grain"}]' | |
for row in $(jq -r '.[] | @base64' <<< "${MY_JSON}"); do | |
_jq() { | |
base64 --decode <<< "${row}" | jq -r ${1} | |
} | |
NAME=$(_jq '.name') | |
TYPE=$(_jq '.type') | |
echo "${NAME} is a ${TYPE}" |
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
-- NOTE Problem with this is that because of the way reocurring events are handled they aren't captured by this script | |
-- See this thread for some workarounds to project reocurring events: https://macscripter.net/viewtopic.php?id=29516 | |
on format24h(provided_date) | |
try | |
set oldDelims to AppleScript's text item delimiters | |
set the_time to time string of provided_date -- something like "4:20:56 PM" | |
set am_pm to characters -2 thru -1 of the_time as string -- is it AM or PM | |
set AppleScript's text item delimiters to ":" | |
set the_hour to text item 1 of the_time as string -- in this example, "4" |
OlderNewer