Scripting BTT won't work - Asks for secret and then does nothing

Describe the bug
Tried setting up shared secret, and couldn't get it to work. Everytime BTT restarts, this window pops up:

If I enter the secret I am using, the window goes away but it doesn't do anything.

Device information:

  • Type of Mac: MBP 16 2021
  • macOS version: 12.4
  • BetterTouchTool version: 3.781

If you set it to an empty secret, it will be disabled again. Deleting it from the keychain should also work, but I saw you other thread about BTT crashing? Could you send one of the crashlogs?

This message shows if a script is executed without the shared secret being included.

Yes, so I deleted the previous thread because I had managed to fix the crashing and thought I could just pick-up from the issue I was having before that.

Anyway, take a read below for the full run-down of events (to the best of my memory) and let me know!

I've emailed the debug logs to you :slight_smile:

Thanks for looking into this.

1.) I had set out to configure some BTT buttons on my StreamDeck.

2.) I consulted this BTT documentation.

3.) I think I already had the box checked but it definitely didn't have a secret, and so I specified one:

4.) I configured the button on the StreamDeck to open a URL with: btt://execute_assigned_actions_for_trigger/?shared_secret=abcd&uuid=660478DF-59E5-45FF-9B34-B6D27B21D122

5.) Weirdly, the button worked only once. I tried restarting BTT and was prompted with:

6.) I entered the app secret again and the window went away, but the button wouldn't work.

7.) I then did a bunch of things such as changing the secret in BTT, unchecking the box, checking if the secret was correct in Keychain (it was), restarting BTT, rebooting my machine, etc.

8.) During the previous step, I realized that "BTTAllowExternalURL_Scripting" was set to "YES2" regardless of whether the box was checked or unchecked in BTT. I thought this was weird as I figured that was the purpose of this keychain entry.

9.) I decided to delete all (both) BTT keychain entries. I thought they would be recreated fresh and possibly solve any issues. This resulted in BTT launching and dying by itself repeatedly. Do note that when I say "dying", i mean to clarify that it didn't produce a crash report.

10.) I had to search the internet for a screenshot of the keychain entry names so that I could recreate them. I found a thread on this forum that had such screenshot.

11.) I recreated BTTAllowExternalURL_Scripting first, but BTT was still launching and dying.

12.) I set BTTAllowExternalURL_Scripting to "NO" hoping, but still the same behavior, so I changed it back to "YES2".

13.) I recreated BTTScriptingSharedSecret and left it empty. Still same behavior with Launching/Dying.

14.) I set BTTScriptingSharedSecret to the secret I had tried using before. Now BTT launches but it keeps asking for the secret:

15.) If i enter a secret that is different from the one I set, it tells me the secret is wrong. If I enter the secret correctly, the same window pops up again and again and again. Only way to be able to use BTT is to click "Cancel". Do note that I am not trying to activate the StreamDeck buttons. This window pops up by itself. The buttons still don't work.

16.) In addition, I've just noticed that all my BTT configured AppleScripts are no longer working. They return "Missing Value"

OK, so BTT is still behaving weirdly went it comes to the Shared Key, BUT I think I figured out why I had trouble getting the StreamDeck buttons to work in the first place.

Firstly, in order for it to work at all, "Get request in background" cannot be checked in the Streamdeck software:

Secondly - and most importantly - BTT Scripting doesn't function in the way I planned for because BTT needs to be frontmost for btt://execute_assigned_actions_for_trigger to work. The way I wanted to set it up was for the streamdeck to switch profiles based on the frontmost application, and then to fill each profile with UUIDs just for that app. This is ideal for me because I can simply reuse stuff I already have in BTT, including things I had created for the now semi-defunct Touch-Bar (I actually use a Touchbar visualizer with my 2021 MBP, so everything is still there and decently usable).

Anyway, is there a way to get this to work the way I intend? Is what I'm looking for related to Web Server feature in BTT?