Did open/close Macbooklid doesn't work?

Hi,
I try to run a script on my MBP (macOS 13.6.1) BTT (4,272) is the lid is open oder closed.
But it doesn't work. If I try to run my script everything is fine, but the trigger itself doesn't work.
Can anyone help me?

Can you try whether the "After Mac Wakes From Sleep" / "Before Mac Goes To Sleep" triggers work instead on your machine?
Or is your Mac not going to sleep?

Hi Andreas,
yes with this triggers work fine and with "pmset -g log" I´ve watched that the "Lid closed/open" comes

Update 27.10.
The Sleep-Trigger functions every time. the Wake-Trigger is on my Mac not reliable. It seems that during short sleeps e.g. 15 minutes he will work but over night or after some hours the trigger doesn't work.

If I check it with pmset I find, that after darksleeps the trigger doesn't work:


Doesn't Work: |2023-10-27 07:21:14 +0200 DarkWake            |DarkWake from Deep Idle [CDN] : due to EC.RTC/Maintenance Using BATT (Charge:55%) 17 secs   |
|---|---|
Work: |2023-10-27 07:59:59 +0200 Wake                |Wake from Deep Idle [CDNVA] : due to EC.LidOpen/UserActivity Assertion Using BATT (Charge:55%) 2618 secs |
Work: |2023-10-27 09:09:05 +0200 Wake                |Wake from Deep Idle [CDNVA] : due to EC.LidOpen/UserActivity Assertion Using BATT (Charge:40%) 216 secs  |
doesn't work: |2023-10-27 11:12:43 +0200 DarkWake            |DarkWake from Deep Idle [CDN] : due to EC.RTC/Maintenance Using BATT (Charge:39%) 7 secs    |

(I´ve set my test-triggers which write into a txt-File [ echo "$(date) OPEN" >> /Users/Simon/Desktop/btt.log. ])

That's interesting. Could you send the logs from ~/Library/Application Support/BetterTouchTool/Logs? (andreas@folivora.ai) Would be interesting to check what wake/sleep events BTT did receive for these long sleeps.

Hi Andreas,
I've send you the logs via Mail
Regards

I have tested a little further.
The triggers "Close and Open-Lid" do not work at all for me - these should be independent of the sleep mode and already trigger when the MBP is closed/opened.
What I also find strange - the trigger "After BTT did Launch ..." triggers several times during the night, i.e. every time my MBP wakes up briefly to sync mails, etc. The function "Restart BTT after standby" is not activated in BTT.

On my MBP currently only the sleep trigger works reliably.

The lid open / close are indeed broken due to another thing I recently fixed. I will look for a better way to implement these.

Oh, do you maybe have the "Restart B After Wake From Sleep" option activated?

This would also explain the wake trigger not working.

I haven't yet looked at your logs, will analyze them on Monday!

No it is not activated - I´ve tried to tell this in my last post :slight_smile:

Can you also reproduce the wakeup-trigger-fault?

Ah sorry! Then it sounds like BTT is crashing and automatically restarting - because the only time these "After BTT did Launch" triggers are triggered, is when BTT initializes. Possibly there are crashlogs in the macOS console app under "Crash Reports".

I don't have much time this weekend, but will post my results on Monday!

Yes I the console I can see that BTT restarts many times. But I cannot see why?
There are no crash-logs
23-10-28 13:12:53.211 BetterTouchProcessPrioWatcher[41577:1555083] BTT did launch 2023-10-28 13:12:53.214 BetterTouchProcessPrioWatcher[41577:1555083] checking signature for bundle: file:///Applications/BetterTouchTool.app/ 2023-10-28 13:12:54.017 BetterTouchProcessPrioWatcher[41577:1555083] signature looks good! 2023-10-28 13:12:54.017 BetterTouchProcessPrioWatcher[41577:1555083] did set BetterTouchTool priority to -2 | 0 2023-10-28 13:12:54.017 BetterTouchProcessPrioWatcher[41577:1555083] BTT did launch 2023-10-28 13:22:57.921 BetterTouchProcessPrioWatcher[41577:1555083] BTT did launch 2023-10-28 13:22:57.924 BetterTouchProcessPrioWatcher[41577:1555083] checking signature for bundle: file:///Applications/BetterTouchTool.app/ 2023-10-28 13:22:58.835 BetterTouchProcessPrioWatcher[41577:1555083] signature looks good! 2023-10-28 13:22:58.835 BetterTouchProcessPrioWatcher[41577:1555083] did set BetterTouchTool priority to -2 | 0 2023-10-28 13:22:58.836 BetterTouchProcessPrioWatcher[41577:1555083] BTT did launch 2023-10-28 13:23:39.589 BetterTouchProcessPrioWatcher[41577:1555083] checking signature for bundle: file:///Applications/BetterTouchTool.app/ 2023-10-28 13:23:39.997 BetterTouchProcessPrioWatcher[41577:1555083] signature looks good! 2023-10-28 13:23:39.997 BetterTouchProcessPrioWatcher[41577:1555083] did set BetterTouchTool priority to -2 | 0 2023-10-28 13:35:20.003 BetterTouchProcessPrioWatcher[41577:1555083] checking signature for bundle: file:///Applications/BetterTouchTool.app/ 2023-10-28 13:35:20.571 BetterTouchProcessPrioWatcher[41577:1555083] signature looks good! 2023-10-28 13:35:20.571 BetterTouchProcessPrioWatcher[41577:1555083] did set BetterTouchTool priority to -2 | 0

Is there anything in here for BTT?

By the way, on macOS 13 and higher you don't need to use the Priority Watcher helper tool anymore. I will remove that soon. I'd recommend to uninstall it

okay, it is installed on my MBP. I will uninstall it and let you know if something changes
BTT has a crash yesterday during editing something - I send you the crash report via Mail

The problem persists without helper-Tool
BTT starts at every wakeup and online the Sleep-Trigger works

I think I have found the issue. Need to work a bit to find the best solution, but I should have a version ready that finally fixes this tomorrow.

I think 4.308 should fix the wake after sleep actions (not the did open/close lid though)

Good Morning Andreas,
thank you for caring about this problem. I will try the knew Version and give you a feedback.

Regards

Thanks that would be great. It's possible it's not yet 100% fixed - but at least I now know where the issue is coming from.

Hey Andreas,
the wakeup seems to work now.
I think it's because BTT didn´t restart anymore during the wakeup so the event starts correct.

1 Like

Hello,
everything works fine, but I have seen, that today at the first wakeup BTT starts the wakeup-trigger and 10 sec later the BTT-Start-Trigger. There no logs at the console.
I think that's not how it should?

ah I think I know where this is coming from. I’ll do another revision later today!