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
- OOwen Granich-Young @Owen_Granich_Young
@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!
OwenChristian Scheuer @chrscheuer2021-11-10 19:40:47.003Z
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 } }
Christian Scheuer @chrscheuer2021-11-10 19:41:41.293Z
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(); }
Ben Rubin @Ben_Rubin
Thank you, @chrscheuer! This is exactly what I needed! And thanks. @Owen_Granich_Young.