No internet connection
  1. Home
  2. Support

Open/Close Radium Sampler as toggle...

By J.R. Fountain @J_R_Fountain
    2020-05-05 18:43:21.182Z2020-05-05 18:50:23.608Z

    Wondering if someone could help me on a Soundminer script. I've got two that I'd like to combine into a toggle. It's for opening and closing the Radium sampler while also turning Re-wire on and off. Here are the two scripts...

    Open Radium, turn off Re-wire...

    sf.ui.soundminer.mainWindow.checkBoxes.whoseTitle.is('').allItems[2].mouseClickElement({
        relativePosition: {"x":30,"y":15},
        anchor: "TopLeft",
    });
    
    sf.ui.soundminer.menuClick({
      menuPath: ["Window","View Sampler Window"],
    });
    

    Close Radium, turn on Re-wire...

    sf.ui.soundminer.menuClick({
      menuPath: ["Window","View Sampler Window"],
    });
    
    sf.ui.soundminer.mainWindow.checkBoxes.whoseTitle.is('').allItems[2].mouseClickElement({
        relativePosition: {"x":30,"y":15},
        anchor: "TopLeft",
    });
    

    Thanks!
    J.R.

    • 6 replies
    1. This should check if Radium is open or not:

      if (sf.ui.soundminer.windows.whoseTitle.is('Soundminer Sampler').first.exists) {
          //Radium is open
      } else {
          //Radium is not open
      }
      
      1. In reply toJ_R_Fountain:
        Dustin Harris @Dustin_Harris
          2020-05-07 12:47:48.234Z2020-05-07 12:55:57.128Z

          Heyyoo JR! :)

          try this:

          (Edit: I added another sampler window check)

          
          
          function stateOne() {
              sf.ui.soundminer.mainWindow.checkBoxes.allItems[2].checkboxSet({
                  targetValue: "Disable",
              })
              sf.ui.soundminer.menuClick({
                  menuPath: ["Window", "View Sampler Window"],
              });
          }
          
          function stateTwo() {
              if (sf.ui.soundminer.windows.whoseTitle.is('Soundminer Sampler').first.exists) {
                  sf.ui.soundminer.windows.whoseTitle.is('Soundminer Sampler').first.windowClose();
              }
              sf.ui.soundminer.mainWindow.checkBoxes.allItems[2].checkboxSet({
                  targetValue: "Enable",
              })
          }
          
          sf.ui.soundminer.soundminerActivateMainWindow();
          
          if (!sf.ui.soundminer.windows.whoseTitle.is('Soundminer Sampler').first.exists) {
          
              stateOne();
          
          } else {
          
              stateTwo();
          
          }
          
          1. JJ.R. Fountain @J_R_Fountain
              2020-05-07 13:27:32.701Z

              Yo Dustin! Thanks man. I actually simplified it a ton because I realized it's already a toggled menu click to open/close Radium, no need to check if it's already open or not.

              I did have a second part to this which was to toggle Rewire on/off because Radium doesn't like to work with Rewire on. However I ditched it because I couldn't get a reliable mouse click (no key command for Rewire). I'm just not gonna use Rewire anymore to audition sounds, though it would be nice if I could for surround material.

              1. Dustin Harris @Dustin_Harris
                  2020-05-07 13:34:02.161Z

                  Cool... Yeah I don't use rewire so I'm not so familiar with the in and outs of it (pun very much intended).

                  The reason I did the checks is: two toggles that don't verify states can become unsynchronized and end up in a state where both rewire and the radium were activating/deactivating at the same time, and as a user you'd have to reset one or the other to return the functionality. The checks would do this automatically :)

                  -D

                  1. JJ.R. Fountain @J_R_Fountain
                      2020-05-07 13:43:10.651Z

                      re: unsyncronized toggles, that's what wasn't working for me on my original script is that they would get out of sync, so maybe I should look at your script. Can Soundflow tell whether the Rewire button is lit up or not though since it's not a checkbox per se?

                      1. Dustin Harris @Dustin_Harris
                          2020-05-07 13:47:42.927Z

                          Yeah, the rewire logo seems to be a graphic button that is just a checkbox, so instead of element clicking it to toggle, I explicitly enable or disable it so it will always be set to a predictable state. :)