I'd like to make it so that as I make new buttons for my floating menu, when I click that button, the name is passed on as a variable to the action script.
For example if I have a button trigger named Apple, and the action script is basically "Hello {{trigger name}}" then it should print Hello Apple,
Is this possible? Struggling a bit and realizing it might be trickier than it sounds.
For context, have a "scene"-switching project associated with a growing list of parameters ("breed", "weight" etc; values would change depending on the scene selected) so being able to name the button the actual parameter would help keep things organized and flexible.
For anyone with a similar question, below's a working js script. You need to paste your own button's UUID.
async function pasteName() {
// 1. Fetch this button's own trigger JSON by its exact UUID
let result = await callBTT('get_trigger', { uuid: 'YOUR BUTTON'S UUID' });
// 2. Parse the returned JSON string
let trigger = JSON.parse(result);
if (Array.isArray(trigger)) {
trigger = trigger[0];
}
// 3. Extract the name (prefer BTTMenuName, fallback to BTTTriggerName)
let name = (trigger && (trigger.BTTMenuName || trigger.BTTTriggerName)) || '';
// 4. Trigger BTT's native 'Paste Custom Text' action (Action 118)
let pasteAction = {
"BTTPredefinedActionType": 118,
"BTTActionTypedString": name,
"BTTActionPaste": 1 // 1 ensures it pastes the text instantly rather than typing it out
};