No internet connection
  1. Home
  2. How to

Add modifier to stream deck button

By Ben Rubin @Ben_Rubin
    2021-11-10 16:15:22.584Z

    hi all,

    i know this can be done but i can't really script so I'm hoping someone could help me please.

    I have a lot of scripts that end with closing the virtual streamdeck it was launched from. I'd like to be able to bypass the closing by holding down command while i click the virtual stream deck button.

    here is my script:

    
    sf.ui.proTools.appActivate();
    sf.ui.proTools.invalidate();
    
    //Calling command "Teezio’s Plugin Loader" from package "Teezio's Plugin Loader" (installed from user/pkg/version "uOwKfD26NbWKAWotin3dmnSne7B3/ckkcztgjh0000jt10i9gi61i5/ckug2jcw00003ck104gt8g4lt")
    sf.soundflow.runCommand({
        commandId: 'user:1624569696752:ckkczttld0001jt10m5krbbh9#ckuurboy60005an1028pcciqi',
        props: {
            pluginName: "Pan Knob",
            pluginCatagory: "Boz Digital Labs",
            pluginSlot: "10",
            presetName: "L 50 PAN",
            pluginWidth: "(mono/stereo)",
        }
    });
    
    sf.ui.proTools.viewCloseFocusedFloatingWindow();
    
    event.deck.close();
    

    thanks much in advance.

    ben

    Solved in post #4, click to view
    • 4 replies
    1. O
      Owen Granich-Young @Owen_Granich_Young
        2021-11-10 16:30:42.264Z2021-11-10 16:48:18.462Z

        @Kitch wrote this If/or/else modifire template here you should be albe to plug your code into : Templating If/Or/Else what am I doing wrong? #post-15

        You can also create two seperate scripts (one that closes, and one that does not) and stick them in my 'Multi-Function buttons for dummys' template if you want (search that title or my name in the store.) I'm pretty coding impaired, so I built these two templates to easily combine scripts in two different multi-layer options.

        Hope that helps!
        Owen

        1. Nice!

          Essentially, the code to do something only if the CMD key is held down would go something like this:

          
          if (event.keyboardState.hasCommand) {
              //Insert things to do only if CMD key is held down here, between the { and the }
          }
          
          
          1. The opposite, as in do something if the CMD key is not held down would be (and here closing the deck):

            if (!event.keyboardState.hasCommand) {
                //Only close the deck if the CMD key is not held down
                event.deck.close();
            }
            
            Reply1 LikeSolution
            1. Ben Rubin @Ben_Rubin
                2021-11-11 13:25:00.855Z

                Thank you, @chrscheuer! This is exactly what I needed! And thanks. @Owen_Granich_Young.