No internet connection
  1. Home
  2. How to

Check if external app is open before launching plugin

By Iain Anderson @Iain_Anderson
    2020-10-12 15:38:37.921Z

    Hi there, new to Soundflow. Currently wondering if there is a way to check if an external app is open before launching a plugin for audiosuite processing. An example is Absentia DX or ReVoice Pro. I'd like to build in a step so that it will check to see if the app is open before launching the plugin and if not, launch the app then continue with the script. Any thoughts? Thanks in advance.

    Solved in post #3, click to view
    • 4 replies
    1. If you have the bundle ID, then you can check for it like this - here I'm checking if Chrome is running:

      if (sf.ui.app('com.google.Chrome').isRunning) {
          log('Chrome is running');
      }
      
      1. If you need to also ensure that it gets started, then you can get away with this oneliner:

        sf.ui.app('com.google.Chrome').appEnsureIsRunningAndActive();
        
        ReplySolution
        1. IIain Anderson @Iain_Anderson
            2020-10-13 13:02:52.186Z

            Great , thanks. Really helpful. Worked a treat!

            1. Dustin Harris @Dustin_Harris
                2020-10-14 03:03:46.596Z

                In case this is useful: I use this plugin too and wrote this bit of code that checks for the external app, and if it's not open, opens it, waits for it to open, then hides it. You can add your audiosuite plugin code after it.

                let abdx = sf.ui.app("com.toddao.absentiadx")
                if (!abdx.exists) {
                
                    sf.app.launch({ path: "Absentia DX" });
                
                    while (!abdx.mainWindow.exists) sf.wait({ intervalMs: 200 });
                
                    abdx.menuClick({
                        menuPath: ["Absentia DX", "Hide Absentia DX",],
                    });
                    sf.ui.proTools.appActivateMainWindow()
                
                }