Skip to content

Instantly share code, notes, and snippets.

@digitaldrummerj
Last active September 16, 2025 23:08
Show Gist options
  • Save digitaldrummerj/3d4ee8c0c49de34c4b0f3bb19425b4ea to your computer and use it in GitHub Desktop.
Save digitaldrummerj/3d4ee8c0c49de34c4b0f3bb19425b4ea to your computer and use it in GitHub Desktop.
#!/bin/bash
# Use on a Mac to get Zoom attendance from ZoomISO or ZoomOSC.
# Companion Action: internal: System: Run shell path (local)
# Path: /users/yourname/attendance-count.sh "$(zoomiso_mini:numberOfUsers)" "$(internal:custom_attendance_hours_to_add)" "$(internal:custom_attendance_file)"
# Timeout: 5000
# Target Variable (stdout): None
# Exammple Output
# "2024-12-19 02:04:20","95"
# "2024-12-19 02:19:20","93"
#----------------------------
# Check if the required arguments are provided
#
if [[ $# -lt 3 ]]; then
echo "Usage: $0 <attendance_count> <hours_to_add> <file_to_append>"
exit 1
fi
# Arguments
attendance_count="$1" # First argument: Attendance count
hours_to_add="$2" # Second argument: Hours to add so that you can get into the right timezone if Companion instance is not in event time
filename="$3" # Third argument: File to append data
echo "Attendance Count: $attendance_count"
echo "Hours to Add: $hours_to_add"
echo "File to Append: $filename"
# Convert the current date and time to the specified time with the added hours
converted_datetime=$(date -v"${hours_to_add}"H +"%Y-%m-%d %H:%M:%S")
echo "Converted Datetime: $converted_datetime"
# Append the attendance count and converted datetime to the specified file
if [[ -n "$attendance_count" && -n "$filename" ]]; then
echo "\"$converted_datetime\",\"$attendance_count\"" >> "$filename"
echo "Data appended to $filename"
else
echo "Error: Invalid arguments."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment