Event Links in Calendar.app - Significant Delay

Original post, below, after confirming the symptom as per @stevelw

In Calendar.app, with calendars in iCloud, I need to keep an event selected for up to 10 seconds before engaging Hook, so that Hook will properly recognize the title/link.

If I engage Hook too quickly after selecting an event, it will show nothing, the last selected event, or sometimes an indecipherable string of characters.

Original post
Unable to copy/link Calendar.app Events, approx 90% of the time

For the last three Hook versions, including this 3.2 beta, I’ve been unable to get a consistent behavior from Hook with an appointment selected in the default Calendar.app.

No matter the view - Day, Week, Month - if I select an event and engage Hook, there will be nothing displayed in the Hook window. If I select another event and engage, the previously-selected event is shown by Hook. Or, sometimes it isn’t and, again, nothing is displayed. If I try a third event, that third event might be displayed or it might, still, display the previous event in Hook.

On the whole, selecting an event and engaging Hook seems to fail about 90% of the time.

For reference, I have this issue on all of my multiple calendars, which are in iCloud.

That sounds like a clipboard timing bug — not on computer at moment so assuming the Calendar script uses the clipboard. Try adding a delay 0.2 between the clipboard being changed and Hook grabbing it.

Thanks, but no. There are no calls to the clipboard in the com.apple.ical script.

I’ve been able to reproduce and have found the issue: there is a delay in macOS between selecting an event and the dictionary (?) Hook is reading being updated.

The delay is more than 4 seconds on my system, so if I add delay 5 to the start of the script Hook thinks the script has frozen and asks if I want to continue — but then clicking continue it will work. A perhaps better :flushed: solution is just to wait 5–10 second before opening Hook.

1 Like

You have something, here. If I select and item, count to ten, and then engage Hook, I’m consistently getting the desired result.

I’d say this is a macOS bug/limitation rather than a Hook bug. It’s weird how poorly Calendar is automated. Hopefully with Shortcuts coming to macOS that will change.

1 Like

Agreed. a goal of ours w macOS 12 is to use Shortcuts with Apple apps to the extent that it can help.