MacGesture/MacGesture

Adding AppleScripts crashes MacGestures

fragster9 opened this issue · 4 comments

Describe the bug
When adding a 3rd Applescript script MacGestures crashes, then every time you visit the Applescript tab afterwards it instantly crashes.

Steps To Reproduce
Steps to reproduce the behaviour:

  1. Go to Applescript tab
  2. Click the + to add 3 new applescripts and MacGestures will crash

Expected behaviour
To allow more than 2 AppleScripts to be added without crashing.

Desktop (please complete the following information):

  • OS: iOS
  • Browser: N/A
  • Version 12.0.1

Additional context
I am trying to replicate xGestures behaviour which allowed a mouse gesture as a shortcut to open/switch to an app. It seems the only way to do this is via AppleScript but MacGestures is instantly crashing when adding more than 2 AppleScripts. I would suggest exporting config before trying this as the only way I've found to restore config afterwards and have the AppleScript tab accessible is to export the config and delete everything in the data tags inside directly below the appleScripts key section, then save that and import.

The error shown in the crash reporting appears to be:

Application Specific Information:
Crashing on exception: *** -[__NSArrayM objectAtIndexedSubscript:]: index 2 beyond bounds [0 .. 1]

Thanks

Not happening on Big Sur, but confirmed on Monterey. 😬 Will look at it. 👍

Well…very dummy issue 😄 there's some attributes setup applied on the tables, yet the table used in AppleScripts tab incorrectly reaches index from the Rules tab – in other words, if you have only n Gesture rules, AppleScript tab fails if you add more than n (<n+1…∞)) items there. 😓 So, as a temporary workaround before we release a fix, you can add some dummy Gesture rules in the Gestures tab to work around this. 👍

Thank you, I created some more dummy gesture rules as suggested and this allows more applescript rules to be added without crashing, making sure I keep n+1 gestures to be safe.

Appreciate your help :)

Properly fixed in the 3.1 release. ✅