Action sequence stops after delay and before a left click (used to work)

Describe the bug
Left click after delay doesn't work. This set of actions activates 100% zoom on zoom application.
Latest version 3.784 has a regression from version 3.756.

The following sequence doesn't work anymore. It gets part way through to the left click and doesn't do anything more. Perhaps it has to do with the change you made to the way delays work.

Affected input device (e.g. MacBook Trackpad, Magic Mouse/Trackpad, Touch Bar, etc.):

Device information:

  • Type of Mac: 2019 Intel 16"
  • macOS version: 11.6.5
  • BetterTouchTool version: 3.784

Scripts:
tell application "System Events" to tell application process "zoom.us"
try
set wsz to size of window 2
--set wsz to size of first window
--display dialog "var = " & item 2 of wsz
set width to ((item 1 of wsz) / 2 + 120)

	-- display dialog "my variable: " & width
	tell application "BetterTouchTool"
		set_number_variable "window_width" to width
	end tell
end try

end tell

(async()=> {
let action = {
"BTTPredefinedActionType" : 153,
"BTTPredefinedActionName" : "Move Mouse To Position",
"BTTMoveMouseToPosition" : undefined,
"BTTMoveMouseRelative" : "1",
};


let wwidth = await callBTT('get_number_variable', {variable_name: 'window_width'});

action.BTTMoveMouseToPosition = "{" + wwidth + ",10}";
//action.BTTMoveMouseToPosition = "{100,100}";
let result = await callBTT('trigger_action', {json: JSON.stringify(action)});

//window.alert(action.BTTMoveMouseToPosition);
returnToBTT(result);

})()

Screenshots


image

have you tried the 3.785 version already? Does the problem still exist there?

left click is the last command successfully executed?

Updated to 3.786 and the issue still exists. It doesn't execute any commands after the Javascript.

It's weird, because the left click comes after the delay. Thus if it were related to the delay stuff it should not execute the left click.

Maybe copy the full (json) config for your action sequence and paste it here (cmd+c & cmd+v), then I can try to run it here.

What exactly does this action sequence do? And are you sure the issue is not caused by a change to zoom?

I haven't updated zoom, but when I switched back and forth between the BTT versions, I noticed it worked on the old but not new.

This set of actions activates 100% zoom on zoom application. It moves to the middle, top of the window of the zoom (zoom.us) screen sharing (remote desktop) application, clicks on the drop down menu and then uses key strokes to select "100%" on the zoom ratio.

Now, it doesn't open the menu at all.

[
{
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTPredefinedActionType" : 154,
"BTTPredefinedActionName" : "Save Current Mouse Position",
"BTTAdditionalConfiguration" : "1048576",
"BTTEnabled2" : 1,
"BTTKeyboardShortcutKeyboardType" : 26364,
"BTTRepeatDelay" : 0,
"BTTUUID" : "008C3F80-A344-48BF-8A6F-5A987891573B",
"BTTTriggerOnDown" : 1,
"BTTNotesInsteadOfDescription" : 0,
"BTTLayoutIndependentChar" : "1",
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTShortcutKeyCode" : 18,
"BTTShortcutModifierKeys" : 1048576,
"BTTOrder" : 3,
"BTTDisplayOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0,
"BTTAdditionalActions" : [
{
"BTTTriggerType" : -1,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTPredefinedActionType" : 172,
"BTTPredefinedActionName" : "Run Apple Script (blocking)",
"BTTInlineAppleScript" : "tell application "System Events" to tell application process "zoom.us"\r\ttry\r\t\tset wsz to size of window 2\r\t\t--set wsz to size of first window\r\t\t--display dialog "var = " & item 2 of wsz\r\t\tset width to ((item 1 of wsz) / 2 + 130)\r\t\t\r\t\t-- display dialog "my variable: " & width\r\t\ttell application "BetterTouchTool"\r\t\t\tset_number_variable "window_width" to width\r\t\tend tell\r\tend try\rend tell",
"BTTEnabled2" : 1,
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "094A0918-0E25-4762-A3BE-82275C4B51B0",
"BTTTriggerOnDown" : 1,
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTShortcutKeyCode" : -1,
"BTTShortcutModifierKeys" : -1,
"BTTOrder" : 0,
"BTTDisplayOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0
},
{
"BTTTriggerType" : -1,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTPredefinedActionType" : 129,
"BTTPredefinedActionName" : "Delay Next Action",
"BTTDelayNextActionBy" : "0.1",
"BTTEnabled2" : 1,
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "3E51D502-D00D-4F2B-B57B-A52472A3EF20",
"BTTTriggerOnDown" : 1,
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTShortcutKeyCode" : -1,
"BTTShortcutModifierKeys" : -1,
"BTTOrder" : 1,
"BTTDisplayOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0
},
{
"BTTTriggerType" : -1,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTPredefinedActionType" : 281,
"BTTPredefinedActionName" : "Run Real JavaScript",
"BTTRealJavaScriptString" : "(async()=> {\nlet action = {\n "BTTPredefinedActionType" : 153,\n\t"BTTPredefinedActionName" : "Move Mouse To Position",\n\t"BTTMoveMouseToPosition" : undefined,\n "BTTMoveMouseRelative" : "1",\n};\n\n\nlet wwidth = await callBTT('get_number_variable', {variable_name: 'window_width'});\n\naction.BTTMoveMouseToPosition = "{" + wwidth + ",10}";\n//action.BTTMoveMouseToPosition = "{100,100}";\nlet result = await callBTT('trigger_action', {json: JSON.stringify(action)});\n\n//window.alert(action.BTTMoveMouseToPosition);\nreturnToBTT(result);\n\n\n})()\n",
"BTTEnabled2" : 1,
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "9CA964D0-94DF-46F7-8C99-822650B55F74",
"BTTTriggerOnDown" : 1,
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTShortcutKeyCode" : -1,
"BTTShortcutModifierKeys" : -1,
"BTTOrder" : 2,
"BTTDisplayOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0
},
{
"BTTTriggerType" : -1,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTPredefinedActionType" : 129,
"BTTPredefinedActionName" : "Delay Next Action",
"BTTDelayNextActionBy" : "0.35",
"BTTEnabled2" : 1,
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "4CF5A5B4-3B34-4D38-ADEA-D4DCB6819E5C",
"BTTTriggerOnDown" : 1,
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTShortcutKeyCode" : -1,
"BTTShortcutModifierKeys" : -1,
"BTTOrder" : 3,
"BTTDisplayOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0
},
{
"BTTTriggerType" : -1,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTPredefinedActionType" : 3,
"BTTPredefinedActionName" : "Left Click",
"BTTEnabled2" : 1,
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "3725C75E-F1D8-4FDA-83BF-2AAD26366425",
"BTTTriggerOnDown" : 1,
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTShortcutKeyCode" : -1,
"BTTShortcutModifierKeys" : -1,
"BTTOrder" : 4,
"BTTDisplayOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0
},
{
"BTTTriggerType" : -1,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTPredefinedActionType" : -1,
"BTTPredefinedActionName" : "No Action",
"BTTAutoAdaptActionToKeyboardLayout" : true,
"BTTShortcutToSend" : "125",
"BTTEnabled2" : 1,
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "4828053F-19F0-447B-97E5-02322BF76E54",
"BTTTriggerOnDown" : 1,
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTShortcutKeyCode" : -1,
"BTTShortcutModifierKeys" : -1,
"BTTOrder" : 5,
"BTTDisplayOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0
},
{
"BTTTriggerType" : -1,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTPredefinedActionType" : -1,
"BTTPredefinedActionName" : "No Action",
"BTTAutoAdaptActionToKeyboardLayout" : true,
"BTTShortcutToSend" : "125",
"BTTEnabled2" : 1,
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "F726C9A8-7DDC-4085-A19A-370B4884EC0A",
"BTTTriggerOnDown" : 1,
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTShortcutKeyCode" : -1,
"BTTShortcutModifierKeys" : -1,
"BTTOrder" : 6,
"BTTDisplayOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0
},
{
"BTTTriggerType" : -1,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTPredefinedActionType" : -1,
"BTTPredefinedActionName" : "No Action",
"BTTAutoAdaptActionToKeyboardLayout" : true,
"BTTShortcutToSend" : "125",
"BTTEnabled2" : 1,
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "4F9EBF72-0F57-4F4D-9EF7-45A6EA95E54B",
"BTTTriggerOnDown" : 1,
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTShortcutKeyCode" : -1,
"BTTShortcutModifierKeys" : -1,
"BTTOrder" : 7,
"BTTDisplayOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0
},
{
"BTTTriggerType" : -1,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTPredefinedActionType" : -1,
"BTTPredefinedActionName" : "No Action",
"BTTAutoAdaptActionToKeyboardLayout" : true,
"BTTShortcutToSend" : "49",
"BTTEnabled2" : 1,
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "9FA66DA3-84E1-4413-B8DD-627713FE4188",
"BTTTriggerOnDown" : 1,
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTShortcutKeyCode" : -1,
"BTTShortcutModifierKeys" : -1,
"BTTOrder" : 8,
"BTTDisplayOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0
},
{
"BTTTriggerType" : -1,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTPredefinedActionType" : 129,
"BTTPredefinedActionName" : "Delay Next Action",
"BTTDelayNextActionBy" : "0.108672",
"BTTEnabled2" : 1,
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "CB545CD4-30D0-4167-8DDA-FB8E01CA5995",
"BTTTriggerOnDown" : 1,
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTShortcutKeyCode" : -1,
"BTTShortcutModifierKeys" : -1,
"BTTOrder" : 9,
"BTTDisplayOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0
},
{
"BTTTriggerType" : -1,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTPredefinedActionType" : 155,
"BTTPredefinedActionName" : "Restore Saved Mouse Position",
"BTTEnabled2" : 1,
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "D72AC131-6809-4A9F-ACE7-19FBB3057225",
"BTTTriggerOnDown" : 1,
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTShortcutKeyCode" : -1,
"BTTShortcutModifierKeys" : -1,
"BTTOrder" : 10,
"BTTDisplayOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0
}
]
}
]

I tried to use this for a different purpose with a music player app and I still have the issue with the new shortcut + action sequence. The Javascript runs but nothing after it. I am trying to do basically the same thing in the music player. Move the mouse using Javascript then do a left click, and then restore mouse position. Is there any reason executing Javascript can prevent the rest of the actions from running ?

I noticed if I run it twice in a row it sort of works. On second run, it doesn't have to move the mouse pointer because previous run already moved it to the calculated spot and that appears to be the reason.

Not sure why something like this would break between versions. Strange.

So, try making a simple test where you move the mouse in Javascript (like shown here) and then doing mouse actions afterwards like "left click" or something like that. My guess is you will see what I'm seeing

Possibly try the new "Delay next action (blocking)" instead of the async delay.

I have been using "Delay next action (blocking)".

There seems to be a problem with using Javascript to move the mouse pointer. The pointer moves, but any BTT actions after that point don't run.

I would suggest trying this Javascript. Then, add some BTT actions after that. I doubt they will run.

(async()=> {
let action = {
"BTTPredefinedActionType" : 153,
"BTTPredefinedActionName" : "Move Mouse To Position",
"BTTMoveMouseToPosition" : undefined,
"BTTMoveMouseRelative" : "3",
};

action.BTTMoveMouseToPosition = "{100,100}";
let result = await callBTT('trigger_action', {json: JSON.stringify(action)});

returnToBTT(result);

})();

I just tried it like this, but that seems to work fine:

Is it maybe specific actions that do not work?

[
  {
    "BTTTriggerType" : 0,
    "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
    "BTTPredefinedActionType" : 281,
    "BTTPredefinedActionName" : "Run Real JavaScript",
    "BTTRealJavaScriptString" : "(async()=> {\nlet action = {\n\"BTTPredefinedActionType\" : 153,\n\"BTTPredefinedActionName\" : \"Move Mouse To Position\",\n\"BTTMoveMouseToPosition\" : undefined,\n\"BTTMoveMouseRelative\" : \"3\",\n};\n\naction.BTTMoveMouseToPosition = \"{100,100}\";\nlet result = await callBTT('trigger_action', {json: JSON.stringify(action)});\n\nreturnToBTT(result);\n\n})();",
    "BTTAdditionalConfiguration" : "1835049",
    "BTTEnabled2" : 1,
    "BTTKeyboardShortcutKeyboardType" : 2302,
    "BTTRepeatDelay" : 0,
    "BTTUUID" : "8E0EFE48-4ACA-4172-AD4F-DFD74BB58D54",
    "BTTTriggerOnDown" : 1,
    "BTTNotesInsteadOfDescription" : 0,
    "BTTLayoutIndependentChar" : "l",
    "BTTEnabled" : 1,
    "BTTModifierMode" : 0,
    "BTTShortcutKeyCode" : 37,
    "BTTShortcutModifierKeys" : 1835008,
    "BTTOrder" : 2,
    "BTTDisplayOrder" : 0,
    "BTTAutoAdaptToKeyboardLayout" : 0,
    "BTTAdditionalActions" : [
      {
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : 5,
        "BTTPredefinedActionName" : "Mission Control",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "EEB8815C-DA9D-4DA3-92EF-66F3045FDD68",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 20,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0
      }
    ]
  }
]

I tried what you did too and that works. You might try saving your mouse position and restoring after moving the pointer with Javascript. That also doesn't work for me.

I did discover one interesting thing. The delay that I put after the "Run Real Javascript" actually ends up running before the Javascript strangely enough. Any ideas on that? It is a "Delay Next Action (blocking)". I set it to 5 seconds and I can see the delay before the Javascript moves the mouse pointer, as if those two actions got reversed.

I can send over diagnostic info if you need it.