leits / MeetingBar

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

Bug: Run AppleScript Automatically not executing #608

Closed mig8447 closed 10 months ago

mig8447 commented 1 year ago

macOS version

13.2.1

MeetingBar version

4.4.0

Installation source

Homebrew

Calendars provider

macOS Calendar app

Bug description

Apple Script is not executed automatically. Executing with "Test on Next Event" works fine

Reproduction steps

  1. Enable "Run Apple Script Automatically"
  2. Select "1 minute before"
  3. Edit the script content and set it to

    on meetingStart(eventId, title, allday, startDate, endDate, eventLocation, repeatingEvent, attendeeCount, meetingUrl, meetingService, meetingNotes)
        tell application "Finder"
            activate
    
            set l_message to "Start: " & ( startDate as text ) & linefeed & "End: " & ( endDate as text )
            # if meetingNotes is not equal to "EMPTY" then
            #     set l_message to l_message & linefeed & linefeed & meetingNotes
            # end if
    
            # set response to button returned of ( display alert "Next Meeting: " & (title as text) message l_message buttons { "Cancel", "Join" } )
            set response to button returned of ( display dialog l_message buttons { "Dismiss", "Join" } default button "Join" with title "Next Meeting: " & ( title as text ) with icon caution )
            if response is equal to "Join" then
                open location meetingUrl
            end if
        end tell
    end meetingStart
  4. Click on "Test on next event" (AppleScript is executed)
  5. Create a new meeting in the calendar
  6. Wait until 1 minute before the meeting (AppleScript is not triggered and/or dialog is not shown)

Expected behavior

The dialog in the Apple Script should be shown

Screenshots/screen recordings

Current settings are as follows

CleanShot 2023-04-11 at 19 38 28@2x CleanShot 2023-04-11 at 19 41 39@2x

Additional context

My goal with the script was to show a UI as close as possible to a modal alert so that the "notification" is in my face

leits commented 10 months ago

Hi @mig8447, Sorry for the delay. I have tried to reproduce the issue and I got the alert! Several releases ago there was a fix related to automatic actions. Perhaps the problem was there. Please check your side with the latest version.

In the meantime, I will close the ticket, because the error is no longer reproduced.

mig8447 commented 10 months ago

This is working after an upgrade to 4.5.1