Describe the bug
I tried the Ask AI feature today for the first time. The job was relatively simple:
i want to take selected text or clipboard content and translate it to english in a hud from which I can select the translation; bound to a BTT key binding
It started working quickly but after making 5 blank items in my keyboard shortcuts seemed to think it was succesful:
I asked if it could try a different method and give me JSON saved to my desktop,
then I tried to import it but still nothing. Here is the generated JSON that does’t look quite right:
[
{
"©TriggerType": 769,
"©TriggerClass": "BTTTriggerTypeKeyboardShortcut",
"©Enabled": 1,
"©TriggerName": "Translate Selection/Clipboard to English",
"©TriggerConfig": {
"keyCode": 117,
"modifiers": 0,
"keyString": "F5"
},
"BTTActions": [
{
"BTTTriggerActionConfig": {
"BTTAction": "BTTGetClipboardContentAction",
"BTTActionConfig": {
"BTTClipboardContent": ""
}
}
},
{
"BTTTriggerActionConfig": {
"BTTAction": "BTTJavaScriptAction",
"BTTActionConfig": {
"BTTJavaScript": "async function translateText() {\n // Get clipboard content from previous action\n let text = BTT.get_action_value(1);\n \n if (!text || text.trim() === '') {\n // If no text in clipboard, try to get selected text\n text = await BTT.get_selected_text();\n }\n \n if (!text || text.trim() === '') {\n BTT.display_notification('No text to translate', 'Error');\n return '';\n }\n \n // Use a translation API (Google Translate free API)\n try {\n let response = await fetch('https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=en&dt=t&q=' + encodeURIComponent(text));\n let result = await response.json();\n let translation = result[0][0][0];\n return translation;\n } catch (error) {\n BTT.display_notification('Translation failed: ' + error.message, 'Error');\n return text;\n }\n}\n\nreturn await translateText();",
"BTTOnlyExecuteIfPreviousActionSucceeded": 1
}
}
},
{
"BTTTriggerActionConfig": {
"BTTAction": "BTTShowHUDWithTextAction",
"BTTActionConfig": {
"BTTText": "TRANSLATED_TEXT",
"BTTWidth": 500,
"BTTHeight": 300,
"BTTBackgroundColor": "255, 255, 255, 255",
"BTTFontColor": "0, 0, 0, 255",
"BTTFont": "Helvetica",
"BTTFontSize": 14,
"BTTAllowTextSelection": 1,
"BTTBorderType": 2,
"BTTOnlyExecuteIfPreviousActionSucceeded": 1,
"BTTUseCustomText": 1
}
}
}
]
}
]
```
Affected input device (e.g. MacBook Trackpad, Magic Mouse/Trackpad, Touch Bar, etc.):
keyboard.
Screenshots
If applicable, add screenshots to help explain your problem. (You can just paste or drag them here)
Device information:
- Type of Mac: macbook air M2
- macOS version: 26.4.1
- BetterTouchTool version: 6.409
Additional information (e.g. crash logs, related issues, etc.):


