Run other actions after Apple Script from a MIDI trigger

I have a MIDI trigger, and I'd like the actions to do:

  1. Run AppleScript to save the MIDI control value to BTT variable.
  2. Restart the timer to run a "Execute Action Sequence after Timeout / Delay" which would load the variable and set system input volume.

This essentially is a debounced volume adjustment by MIDI control, since directly piping trigger values would lead to race conditions (volume jumps up and down as I'm slowly increasing MIDI control value).

Now from my testing it seems that if I have the "Run Apple Script (async)" (that runs bttMIDIValueChanged and saves the MIDI control value in a BTT variable) as the first action, then nothing below it runs at all. If I have other actions in front of the "Run Apple Script (async)" action, then the Apple Script is run in an entirely different way (i.e. not calling bttMIDIValueChanged at all).

How can I have other actions run after the "Run Apple Script (async)" action?

true, that’s a bug. It has been reported before, but your explanation finally made
me realize why it is happening. I’ll fix it!

1 Like