Mac Shortcuts app repeats calendar selection from dock
I'm using the shortcuts app on my Mac to create a note in the Bear Notes app. The shortcut script I've created works great when I run within the shortcuts app (developer mode) but not when I launch it independently from the dock (production mode).
The script looks at my calendar and allows me to select an event from today before moving on. When I save the script into my dock and launch it independently, I get the window allowing me to select a calendar event but once selected, the window closes and then re-opens asking me to select again. Once an event is selected a second time the script runs normally.
This is the start of the script and the part that's effectively repeated...
Any suggestions?
MacBook Air 13″, macOS 26.1