Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Open Calendar' opens Calendar.app to the wrong event #244

Open
SquaredTiki opened this issue Jun 10, 2024 · 7 comments
Open

'Open Calendar' opens Calendar.app to the wrong event #244

SquaredTiki opened this issue Jun 10, 2024 · 7 comments

Comments

@SquaredTiki
Copy link

Something strange seems to be happening for me when I use 'Open Calendar' in Itsycal to try to edit an event in Calendar.app.

If Calendar.app is closed at the time I click 'Open Calendar' on an event then it seems Calendar.app opens but highlights the event I last 'opened in Calendar' with.

If Calendar.app is open at the time I click 'Open Calendar' on an event then Calendar.app highlights an event that's off by one or two from the one I actually wanted. If I click 'Open Calendar' on an event that is on the same day Calendar.app already has visible then the selected event does not change.

I can't tell if this is a Calendar.app bug or an Itsycal bug.

@sfsam
Copy link
Owner

sfsam commented Jun 25, 2024

I'll have to investigate. I think I'm seeing something similar and I don't think it used to do this. I don't think I've changed anything, but can't be sure. Can you tell me what version of macOS you are on?

@SquaredTiki
Copy link
Author

I'm on macOS 14.5

@sfsam
Copy link
Owner

sfsam commented Jul 1, 2024

Yes, 14.5 here as well. I'm going to tentatively call this an Apple bug.

I just tried controlling Calendar using Apple's Script Editor app. I gave it the following AppleScript:

tell application "Calendar"
    view calendar at current date
end tell

It opened Calendar to the last selected date (as you describe above) instead of the current date. But doing this a number of times I am unable to reliably get the bad behavior. Sometimes it works (!), sometimes it doesn't.

I also tried using AppleScript inside of Itsycal instead of my current ScriptingBridge implementation. As with Script Editor, sometimes it works and sometimes it doesn't. I'm stumped at the moment.

@sfsam
Copy link
Owner

sfsam commented Jul 1, 2024

I think Calendar.app might have some logic in it that remembers the previous date it was set to. If Calendar.app is closed and I open it to a new date with Itsycal, if I watch very closely I will see Calendar.app open to the correct date and then quickly revert to the previously selected one. It happens quickly so it seems like it is just opening at the wrong date.

Can you see if you notice this too?

When I change Itsycal's logic to open Calendar.app, wait 0.5 seconds, and then navigate to the date, it seems to work.

@sfsam
Copy link
Owner

sfsam commented Jul 1, 2024

I've made a test version with the delay if you'd like to try:
https://itsycal.s3.amazonaws.com/Itsycal-0.15.3-open-calendar.zip

@SquaredTiki
Copy link
Author

So interesting. That does seem to fix it not opening to the correct date, but it doesn't seem to fix it not opening to the correct event. Screen recording here: https://dropover.cloud/aa8e8f.

@sfsam
Copy link
Owner

sfsam commented Jul 3, 2024

Correct. The granularity is to the day, not the event unfortunately. I don't know how to open a specific event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants