Describe the bug
My keyboard shortcut objective is to replace a given string pattern in the selected text.
Should all be very simple :
With the following javascript
var betterTouchTool = Application('BetterTouchTool');
var url = betterTouchTool.get_string_variable("selected_text");
url = url.replace(/.+[?&]q=(.+)?&.*$/, '$1 - Google Suche');
betterTouchTool.set_string_variable("new_text", {to: url} ) ;
The bug is that when I test the key, the script locks BTT and times out after a minute or so.
If I test the script part using the "run script" button in the action configuration pane it also blocks and after a minute I get an error dialog saying
AppleScript Error:
Error on line 2: Error: AppleEvent timed out.
The script compiles fine and I have tested the script logic and it works fine.
Device information:
- Type of Mac: MBP 2018
- macOS version: Catalina 10.15.1
- BetterTouchTool version: 3.209
Additional information (e.g. StackTraces, related issues, screenshots, workarounds, etc.):
I have tried alternatively using the Shell script action with the same javascript and there it runs fine (ie. not blocking/timing out) but I have other issues related to the timing of the variable contents (ie. I get the results of the 1st keypress when I test the key a 2nd time, very odd). Seems to be another unrelated issue, so let's focus on the above initial one for now...