BetterTouchTool >= 4.191 (August, 26, 2023)
- All BTT scripting functions can now be called from JavaScript without using "callBTT" (e.g. await get_string_variable({'variable_name': "test"})
this one is not workin for real javascript
running latest alpha
working code
(async()=>{
n=(await callBTT("get_string_variable",{variableName:"hovered_element_details"})).split('<AXApplication: "')[1].split('"')[0]
callBTT('trigger_named_async_without_response',{trigger_name:'swmfloat'})
callBTT('set_persistent_string_variable',{variable_name:'SWM-FA',to:(await runAppleScript(`
tell app "System Events"
tell process "BetterTouchTool"
tell (first window whose size is {280,150}) to try
set {x,y} to position
set position to {x+50,y+60}
end try
set frontmost to true
end tell
tell (first process where displayed name is "`+n+`")
short name & ":" & (value of attribute "AXFullScreen" of window 1)
end tell
end tell
`))})
returnToBTT(1)
})()
i guess only trigger_named_async_without_response working on this code
am i missing something? i tried object key without quotes but result same
(async()=>{
n=(await get_string_variable({'variableName':"hovered_element_details"})).split('<AXApplication: "')[1].split('"')[0]
trigger_named_async_without_response({'trigger_name':"swmfloat"})
set_persistent_string_variable({'variable_name':"SWM-FA",'to':(await runAppleScript(`
tell app "System Events"
tell process "BetterTouchTool"
tell (first window whose size is {280,150}) to try
set {x,y} to position
set position to {x+50,y+60}
end try
set frontmost to true
end tell
tell (first process where displayed name is "`+n+`")
short name & ":" & (value of attribute "AXFullScreen" of window 1)
end tell
end tell
`))})
returnToBTT(1)
})()