Unable to export preset when "prevent recursive triggers" is selected.

BTT version: 3.560 (1700)
macOS version: 11.2.3
Type of Mac: MacBook Pro (13-inch, M1, 2020)

I'm unable to export my preset when a keyboard trigger exists with "prevent recursive triggers" selected.

Once I uncheck "prevent recursive triggers" from every trigger I have, I'm able to export successfully.

It doesn't seem to be any particular trigger that causes it, I've created a brand new trigger and the same happens. Only when nothing has it selected can I export.

Here's the error that shows in the log, it repeats twice each time I try to export.

ASL|-[NSSavePanel didEndPanelWithReturnCode:] caught non-fatal NSInvalidArgumentException '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: BTTKeyboardPreventRecursiveTriggers)' with backtrace (
	0   CoreFoundation                      0x000000018949e320 __exceptionPreprocess + 240
	1   libobjc.A.dylib                     0x00000001891ccc04 objc_exception_throw + 60
	2   CoreFoundation                      0x0000000189565064 -[__NSCFString characterAtIndex:].cold.1 + 0
	3   CoreFoundation                      0x000000018957345c -[__NSDictionaryM setObject:forKey:].cold.3 + 0
	4   CoreFoundation                      0x00000001893d93e8 -[__NSDictionaryM setObject:forKey:] + 904
	5   BetterTouchTool                     0x000000010052a354 -[OrderedDictionary setObject:forKey:] + 152
	6   BetterTouchTool                     0x0000000100683e0c -[BTTJSONExporter convertTraitForGesture:] + 984
	7   BetterTouchTool                     0x00000001006812e4 -[BTTJSONExporter convertGestureToJSON:] + 596
	8   BetterTouchTool                     0x00000001006816a4 -[BTTJSONExporter convertGesturesToJSON:] + 228
	9   BetterTouchTool                     0x000000010068030c -[BTTJSONExporter exportApps:fromMasterPreset:includeTriggersFromAdditionalPresets:onlyIncludeTriggerClasses:] + 2036
	10  BetterTouchTool                     0x000000010067dc0c -[BTTJSONExporter exportPreset:includeAllSettings:compress:toLocation:minVersion:comment:link:] + 1404
	11  BetterTouchTool                     0x000000010067f00c __32-[BTTJSONExporter exportPreset:]_block_invoke + 236
	12  AppKit                              0x000000018c616bec -[NSSavePanel didEndPanelWithReturnCode:] + 88
	13  AppKit                              0x000000018c616ee8 -[NSSavePanel completeModeless:] + 32
	14  AppKit                              0x000000018c617248 -[NSSavePanel completeWithReturnCode:url:urls:] + 440
	15  AppKit                              0x000000018c618cb4 -[NSSavePanel observeValueForKeyPath:ofObject:change:context:] + 340
	16  Foundation                          0x000000018a17a1b4 NSKeyValueNotifyObserver + 292
	17  Foundation                          0x000000018a24a360 NSKeyValueDidChange + 328
	18  Foundation                          0x000000018a2f55e4 NSKeyValueDidChangeWithPerThreadPendingNotifications + 160
	19  ViewBridge                          0x000000018fad062c __41-[NSViewBridge setObject:forKey:withKVO:]_block_invoke + 360
	20  ViewBridge                          0x000000018fb524a0 withHintInProgress + 360
	21  ViewBridge                          0x000000018fac7910 -[NSViewBridge setObject:forKey:withKVO:] + 632
	22  ViewBridge                          0x000000018fac8c7c -[NSViewBridge nonLocalChangeInProgress:block:] + 236
	23  ViewBridge                          0x000000018fac8974 -[NSRemoteViewMarshal exceptionSafeSetRemoteObject:forKey:withReply:] + 244
	24  ViewBridge                          0x000000018fac8830 -[NSRemoteViewMarshal setRemoteObject:forKey:withReply:] + 72
	25  CoreFoundation                      0x0000000189401894 __invoking___ + 148
	26  CoreFoundation                      0x000000018940171c -[NSInvocation invoke] + 448
	27  ViewBridge                          0x000000018fac6638 __deferNSXPCInvocationOntoMainThread_block_invoke + 248
	28  ViewBridge                          0x000000018fab8ee4 __wrapBlockWithVoucher_block_invoke + 56
	29  ViewBridge                          0x000000018fab8bcc __deferBlockOntoMainThread_block_invoke_2 + 432
	30  CoreFoundation                      0x00000001894206c0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
	31  CoreFoundation                      0x0000000189420534 __CFRunLoopDoBlocks + 408
	32  CoreFoundation                      0x000000018941f570 __CFRunLoopRun + 1732
	33  CoreFoundation                      0x000000018941e740 CFRunLoopRunSpecific + 600
	34  HIToolbox                           0x0000000190f435c4 RunCurrentEventLoopInMode + 292
	35  HIToolbox                           0x0000000190f433f4 ReceiveNextEventCommon + 688
	36  HIToolbox                           0x0000000190f43124 _BlockUntilNextEventMatchingListInModeWithFilter + 76
	37  AppKit                              0x000000018bbf882c _DPSNextEvent + 868
	38  AppKit                              0x000000018bbf71ac -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1312
	39  AppKit                              0x000000018bbe9060 -[NSApplication run] + 600
	40  AppKit                              0x000000018bbba804 NSApplicationMain + 1064
	41  libdyld.dylib                       0x0000000189341f34 start + 4
)|

I have the same issue with the same repro and the workaround (uncheck "Prevent recursive triggers" on all triggers before saving).

OS Version: macOS Catalina Version 10.15.4
BTT Version: 3.562 (Build 1702)
Machine: Macbook Air (Retina, 13-inch, 2018)

1622437602.568813|ASL|-[NSSavePanel observeValueForKeyPath:ofObject:change:context:] caught non-fatal NSInvalidArgumentException '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: BTTKeyboardPreventRecursiveTriggers)' with backtrace (        0   CoreFoundation                      0x00007fff2fccbd07 __exceptionPreprocess + 250
    1   libobjc.A.dylib                     0x00007fff688565bf objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff2fd7a63e -[__NSCFString characterAtIndex:].cold.1 + 0
    3   CoreFoundation                      0x00007fff2fd8519c -[__NSDictionaryM setObject:forKey:].cold.3 + 0
    4   CoreFoundation                      0x00007fff2fc09459 -[__NSDictionaryM setObject:forKey:] + 976
    5   BetterTouchTool                     0x000000010aea1afa -[OrderedDictionary setObject:forKey:] + 147
    6   BetterTouchTool                     0x000000010b010a9e -[BTTJSONExporter convertTraitForGesture:] + 992
    7   BetterTouchTool                     0x000000010b00dc1f -[BTTJSONExporter convertGestureToJSON:] + 578
    8   BetterTouchTool                     0x000000010b00e080 -[BTTJSONExporter convertGesturesToJSON:] + 276
    9   BetterTouchTool                     0x000000010b00cbba -[BTTJSONExporter exportApps:fromMasterPreset:includeTriggersFromAdditionalPresets:onlyIncludeTriggerClasses:] + 2657
    10  BetterTouchTool                     0x000000010b009e70 -[BTTJSONExporter exportPreset:includeAllSettings:compress:toLocation:minVersion:comment:link:] + 1631
    11  BetterTouchTool                     0x000000010b00b4f0 __32-[BTTJSONExporter exportPreset:]_block_invoke + 235
    12  AppKit                              0x00007fff2d8c1e29 -[NSSavePanel didEndPanelWithReturnCode:] + 68
    13  AppKit                              0x00007fff2d8c1f83 -[NSSavePanel completeModeless:] + 23
    14  AppKit                              0x00007fff2d8c2384 -[NSSavePanel completeWithReturnCode:url:urls:] + 445
    15  AppKit                              0x00007fff2d8c4259 -[NSSavePanel observeValueForKeyPath:ofObject:change:context:] + 341
    16  Foundation                          0x00007fff322b6550 NSKeyValueNotifyObserver + 335
    17  Foundation                          0x00007fff323a57bc NSKeyValueDidChange + 437
    18  Foundation                          0x00007fff324474e1 NSKeyValueDidChangeWithPerThreadPendingNotifications + 146
    19  ViewBridge                          0x00007fff626bd5b0 __41-[NSViewBridge setObject:forKey:withKVO:]_block_invoke + 360
    20  ViewBridge                          0x00007fff62740dc0 withHintInProgress + 472
    21  ViewBridge                          0x00007fff626b3cd3 -[NSViewBridge setObject:forKey:withKVO:] + 856
    22  ViewBridge                          0x00007fff626b53d6 -[NSViewBridge nonLocalChangeInProgress:block:] + 352
    23  ViewBridge                          0x00007fff626b5033 -[NSRemoteViewMarshal exceptionSafeSetRemoteObject:forKey:withReply:] + 264
    24  ViewBridge                          0x00007fff626b4ee7 -[NSRemoteViewMarshal setRemoteObject:forKey:withReply:] + 56
    25  CoreFoundation                      0x00007fff2fc31a6c __invoking___ + 140
    26  CoreFoundation                      0x00007fff2fc31911 -[NSInvocation invoke] + 303
    27  ViewBridge                          0x00007fff626b2684 __deferNSXPCInvocationOntoMainThread_block_invoke + 228
    28  ViewBridge                          0x00007fff626a10d8 __wrapBlockWithVoucher_block_invoke + 37
    29  ViewBridge                          0x00007fff626a0ea7 __deferBlockOntoMainThread_block_invoke_2 + 507
    30  CoreFoundation                      0x00007fff2fc4fbac __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    31  CoreFoundation                      0x00007fff2fc4faf4 __CFRunLoopDoBlocks + 379
    32  CoreFoundation                      0x00007fff2fc4efed __CFRunLoopRun + 2450
    33  CoreFoundation                      0x00007fff2fc4dffe CFRunLoopRunSpecific + 462
    34  HIToolbox                           0x00007fff2e881abd RunCurrentEventLoopInMode + 292
    35  HIToolbox                           0x00007fff2e8817d5 ReceiveNextEventCommon + 584
    36  HIToolbox                           0x00007fff2e881579 _BlockUntilNextEventMatchingListInModeWithFilter + 64
    37  AppKit                              0x00007fff2ceccc99 _DPSNextEvent + 883
    38  AppKit                              0x00007fff2cecb4e0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
    39  AppKit                              0x00007fff2cebd1ee -[NSApplication run] + 658
    40  AppKit                              0x00007fff2ce8eff6 NSApplicationMain + 777
   41  libdyld.dylib                       0x00007fff699fdcc9 start + 1
Imprint | Privacy Policy