No internet connection
  1. Home
  2. How to

Enable/Disable Keyboard Trigger via Macro or Script?

By Aaron McCourt @Aaron_McCourt
    2021-10-15 18:35:57.853Z

    I'm wondering if it's possible to enable/disable a keyboard trigger on a script from another macro or script?

    Some context:
    I have a series of macros that I use to clear a video offset when I'm bouncing a QuickTime and then re-enter the offset once the bounce is done. (This way I don't forget to re-enter the offset once the QuickTime is completed!)

    I'm a freelancer and have a number of studios I work out of which all have different video offsets and also different ProTools versions. Right now I just go into the SoundFlow script editor and enable the keyboard trigger for the script that has the correct offset & either "Bounce Mix" or "Bounce QuickTime" for the room I'm working in. Not a huge deal BUT I would love to be able to have a series of buttons on my stream deck to enable the keyboard shortcut on the macro that corresponds with the studio I'm working in!

    Anyone know if this is doable?

    • 3 replies
    1. Hey Aaron,

      From what I can tell you're asking if SF can be used to control SF. Unfortunately this is not possible. Looking at your scenario, It seems the best solution would be to use a different keyboard trigger for each command/offset.

      1. In reply toAaron_McCourt:

        You can also change the script itself so it reads the computer's hostname and then looks up a table of offsets based on each computer and uses that to determine what to fill in :)

        1. Something like this - then use the offset variable to set your QT offset as before.

          
          const offsetByHostName = {
              'Christians-MacBook-Air-5': 14,
              'Christians-Mac-Pro': 27,
          };
          
          var hostName = sf.system.hostNameGet().hostName.split('.local')[0];
          log(`This computer's hostname is '${hostName}'`);
          
          var offset = offsetByHostName[hostName];
          if (offset === undefined) throw `There's no offset defined for computer with hostname '${hostName}'`;
          
          log(`Offset chosen: ${offset}`);