Using this method led to the following bug (Reported here). What is your advice?
Describe the bug
Red Window Button does not properly after defining Automations & Named & Other Triggers:
- Red Window Button does not work at all after quitting BetterTouchTool (e.g., BTT crashes and closed automatically)
- Clicking on Red Window Button in an app, randomly closes other apps' windows!
- Clicking on Red Window Button in web browsers' private/incognito windows closes tabs instead windows!
- Clicking on Red Window Button in Microsoft Edge shows a menu instead of closing the window!
Screenshots
Clicking on Red Window Button in the Activity Monitor app closes Firefox! (Note: Activity Monitor is the active window):
Clicking on Red Window Button in Microsoft Edge shows a menu instead of closing the window:
Device information:
- Type of Mac: MacBook Air M1
- macOS version: 12.6.3 (21G419)
- BetterTouchTool version: 4.023 (2240)
Additional information:
The following Apple Script is defined to run when clicking on Red Window Button based on this topic:
tell application "System Events"
set activeProcesses to first process where it is frontmost
repeat with theProcess in activeProcesses
if not background only of theProcess then
tell theProcess
set processName to name
set theWindows to windows
end tell
set windowsCount to count of theWindows
end if
end repeat
end tell
if windowsCount is less than or equal to 1 then
tell application (get path to frontmost application as text)
quit
end tell
else
tell application "System Events"
keystroke "w" using command down
end tell
end if