I want my weekly calendar view to be yesterday + 7 days. I can’t seem to find any api surfaced in automator or shortcuts to even change the calendar view. What I’m after is a shortcut/script/automation I can bind over cmd-t so that instead of going to the default (bad) week view it would set the view to be what I want. Any ideas? Google failed me and chatgpt hallucinated a lovely little fantasy about custom view options with relative dates (exactly what I want but it does not exit).
I found a reference that still calls it ical (Calendar (iCal) - defaults-write.com) and copy/pasting from that site won’t even let me turn on the debug menu. Are you aware of a more current list of what’s actually defaults writeable?
set aWeekFromYesterday to (((current date) - 24 * hours) + 7 * days)
tell application id "com.apple.ical"
view calendar "Personal" at aWeekFromYesterday
switch view to week view
end tell
I don’t know why AppleScript never crossed my mind. I’ll see if I can make that work. The code as-written just moves the view to next week so somethings a bit off. I messed with the formula and all I can only get the view to change from this week to next week (or any week given enough adding and subtracting). It’s like the at SomeValue is always snapping to week. Any way to change that behavior?
Nevermind, got it. Change “Scroll in week view by:” from Week to Day, then modified the script to:
set aWeekFromYesterday to ((current date) - 1 * days)
tell application id "com.apple.ical"
switch view to week view
view calendar "Personal" at aWeekFromYesterday
end tell