https://github.com/user-attachments/assets/af3d70d8-5223-461b-8146-6b6de1e8e3d1

Open log-past-x-minutes-to-cal in Script Kit

// Name: Log Past X Minutes to Calendar
// Description: Asks for duration in minutes, event title, and (on first use) calendar name
// Author: Pavel 'Strajk' Dolecek <www.strajk.me>
// Twitter: @straaajk
// me.strajk:status SHARED
const minutes = await arg("Enter the duration (in minutes) to log retroactively")
const title = await arg("Describe the activity you want to log")
let calendar = await env("SCRIPTKIT_LOG_CALENDAR_NAME", {
hint: `Enter the exact name of an existing calendar in your Calendar app`,
})
await applescript(`
tell application "Calendar"
switch view to week view
tell calendar "${calendar}"
set theCurrentDate to current date
make new event at end with properties {summary:"${title}", start date:theCurrentDate - ${minutes} * minutes, end date:theCurrentDate}
end tell
end tell
`)
await notify(`Logged ${minutes} minutes of ${title} to ${calendar}`)