Skip to content

Instantly share code, notes, and snippets.

@damc-dev
damc-dev / GetZoomParticipants.scpt
Last active March 8, 2024 15:13
Applescript to Retrieve Participants From Zoom MacOS App
#!/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()
@damc-dev
damc-dev / loopjson-simple.sh
Last active October 20, 2022 14:18
Loop over JSON list of objects with jq in bash
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}"
@damc-dev
damc-dev / get-todays-calendar-events.applescript
Created November 30, 2022 16:11
Partially working applescript to retrieve todays calendar entries and add to clipboard (Note doesn't capture reoccurring entries)
-- 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"