leits / MeetingBar

🇺🇦 Your meetings at your fingertips in the macOS menu bar
https://meetingbar.app
Apache License 2.0
4.43k stars 191 forks source link

Feature: Run AppleScript automatically when event ends #504

Open A-Shleifman opened 1 year ago

A-Shleifman commented 1 year ago

First of all, thank you very much for this amazing app!

I have a feature request. I want my laptop to go into DND mode during certain events (calls, focus work).

DND settings on Android allow to go into DND mode during events in a specific calendar. So I have two calendars in my Google Account: the main one and a separate DND calendar.

I added a very simple script which MeetingBar runs when an event starts:

on meetingStart(eventId, title, allday, startDate, endDate, eventLocation, repeatingEvent, attendeeCount, meetingUrl, meetingService, meetingNotes)
   do shell script "shortcuts run work-mode-on"
end meetingStart

The shortcut that I've created just enables the Work Focus mode.

I want to be able to do the opposite when an event ends (or gets deleted), and then I'll have a perfect indistractable setup.

Two problems preventing this from happening:

  1. There's no option to run a script when an event ends (I could use the endDate parameter and schedule a shell command, but what if the event changes?)
  2. There's no parameter that allows to differentiate between calendars. I don't want the main calendar to trigger this behaviour, but I still want to see the main calendar events in the menu bar.

Any chance you could implement this?

jgoldhammer commented 1 year ago

Hi @A-Shleifman , sounds like a nice idea. If I remember correctly, I had a prototype running it - I will try to implement it. Which parameter do you need in this function? Do you need the calendar name for it?

A-Shleifman commented 1 year ago

Hi @jgoldhammer, thank you very much for picking this up! Two things are required for this scenario to work:

1) the calendar name parameter as you said 2) the ability to provide both meetingStart and meetingEnd functions.

meetingEnd should probably run even if the current calendar event was removed/shortened during the event itself.

sergeystoma commented 1 year ago

Would love to have a "meeting ends" event - for example I want to control my On Air sign. One thing to test is to make sure that back-to-back events are handle in the proper order...

hunleyd commented 10 months ago

Curious if there's been any progress here @jgoldhammer ?