execution of Apple scripts seems to have stopped working

Having related issues with 4.226 macOS 13.5.2 Mac mini M2 Pro controlling a Stream Deck… Stream Deck button executes an AppleScript asynchronously to call a Keyboard Maestro passing a parameter — seemed to be calling it multiple (four?) times. Also in a following step would set "customVariable1" to a value (with Persist option) this didn't appear to be getting set and BTT Scripting Settings confirmed this. Also had several BTT crashes… — I restored to 4.215 and things appear back to normal. :+1:

I think I have found a related issue, hope it will be fixed with the next alpha later today!

Possibly the issue I found was not related after all, but I'm not yet sure. Would be great if you could try with v4.227

:+1::+1::-1:
I've been running v4.227 for about an hour and it hasn't crashed.
customVariable1 is being set correctly and being detected by BTT — menu bar display.
But the craziness continues with the Keyboard Maestro macros…
I've cut the logic out of the macros and now all they do is display text and the value of variables.
My Stream Deck is fully controlled by BTT
I'm using a Toggle On / Off Button
The On action runs a simple AppleScript asynchronously:

tell application "Keyboard Maestro Engine"
	do script "JT_Start task" with parameter "1"
end tell

Then sets a BTT custom variable.
:point_right: What I see happening is the macro "JT_Start task" gets called twice — causing the chaos…

The Off action sets a BTT custom variable to null and then runs a simple AppleScript asynchronously:

tell application "Keyboard Maestro Engine"
	do script  "JT_End task"
end tell

:point_right: What I see happening is the macro "JT_Start task" gets called (from the On action) followed by the "JT_End task".

Regrettably, there's no sign of improvement here. It seems to be working in a somewhat puzzling way, behaving both effectively and ineffectively at the same time. There's a significant delay present that doesn't exist under btt4.219, and it's presenting me with outdated icons that shouldn't still be there since I've completely recreated the trigger.

@SLE that sounds like it's still using your old trigger. That would also completely explain the issue. Could you copy & paste the currently created one again and send it to me? Then I can check whether it still contains the old / corrupted data (for whatever reason). I'll then modify the json so you can import it again.

I'll also add a workaround so it can work with the "corrupted" data - I didn't do that yet to not cause more confusion

@Ferrers ahh you are using the Toggle On/Off, that explains this one. Will be fixed with the next alpha!

@Ferrers your issue should be fixed in 4.229

@SLE weird, your trigger looks fine. Are the graphics maybe coming from old named triggers?
I now have a Indesign installation and willy try to get the script running here.

It's possible, but if there is an old one it definitely is not active. But why does it work fine under version 4.119? And a completely new trigger shouldn't access anything else, right?

Did you also re-create the related named triggers?

I'm trying to figure out why it worked in the older version. (when downgrading to the previous version, BTT will load the old data file, so it could either be a change in BTT or a change in the trigger configuration between the two versions)

So far all my test cases work in both, the old and new version - but it's possible I missed something. Still analyzing this.

:+1: My Stream Deck & Keyboard Maestro macros are happy with v4.229 — Thank you.

So, all elements completely recreated. Tested under 2.19 - everything works. Updated to 4.232 - the same problem as before. Significant time delay, very old logos, HUD is only visible for a very short time.
No progress here =(

if you didn't delete the database files from 4.2xx versions, the triggers you re-created in 2.19 would not be the same as in your now updated 4.232 (up and downgrading is complicated database wise).

Could you maybe send me a copy of your whole ~/Library/Application Support/BetterTouchTool folder (it might be big)? Then I will definitely be able to see what is wrong.

I have sent you a wetransfer link. thx

Thanks a lot. I think it confirmed my assumption.

I need to investigate a bit further this afternoon, but possibly 4.233 already helps (currently building & uploading). It will now display actions that were still in the database due to a logic error, but previously not shown in the UI like this:

Also it should ignore these actions during action sequence execution.

A small step forward - the old icons have disappeared. However, there's a noticeable lag in executing scripts compared to version 2.19. Version 2.19 responds instantly, whereas version 4.233 takes a moment to consider, approximately 3-5 seconds.

EDIT
Following the removal of these corrupt elements, it has become faster. BTT doesn't outright ignore them but seems to perform an initial check, which takes some time. The speed now approaches that of 2.19, though it still feels a bit slower. Nevertheless, the difference remains acceptable to me.

That makes sense, thanks for comparing! I think I found one thing related to HUDs that could cause a little more delay than previously. I have removed that now in 4.234

I'm still deciding whether I should automatically delete these "bad actions", but I'm not yet 100% sure whether that would cause any side effects. Not many people should be affected by it because the corruption only happened in a very specific scenario.