Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# Check CPU usage
#
# ===
#
# Examples:
#
# check-cpu.sh -w 85 -c 95
#
@goulon
goulon / UpdateBusyCalendar.scpt
Created December 14, 2023 05:13
AppleScript to update a busy calendar based on target calendars to show times when you're busy through a shared calendar.
on run argv
-- Check if enough arguments are provided
if (count of argv) < 5 then
display dialog "Please provide the number of days to consider, minutes of margin time, the generic busy event summary, the busy calendar name, and at least one target calendar name."
return
end if
-- Extract arguments
set daysToConsider to item 1 of argv as number
set marginTimeInMinutes to item 2 of argv as number