No internet connection
  1. Home
  2. Script Sharing

Open Any Fade Window run Preset and close

By Owen Granich-Young @Owen_Granich_Young
    2022-02-18 20:07:21.136Z

    Mosty found the code on the forum, but consolidated here. Buttons 1-5 in any fade window, have the fade selected press your button, bam. I don't ever use keyboard 1-5 so i've placed these there and use them allll the time.

    //Activate Pro Tools
    sf.ui.proTools.appActivate();
    sf.ui.proTools.invalidate();
    
    sf.ui.proTools.menuClick({
        menuPath: ["Edit","Fades","Create..."],
    });
    
    sf.ui.proTools.windows.whoseTitle.contains('Fade').first.buttons.whoseTitle.is('Fade Preset Toggle').allItems[0].elementClick(); ///0-4 is presets 1-5
    
    sf.ui.proTools.windows.whoseTitle.contains('Fade').first.buttons.whoseTitle.is("OK").first.elementClick();
    
    • 3 replies
    1. Kitch Membery @Kitch2022-02-18 21:45:37.087Z

      Nice one, Owen!

      1. R
        Rakel Pascual @Rakel_Pascual
          2023-02-24 18:48:43.202Z

          Hi Owen!
          The script is working great!
          I'm beginner in coding and I have some questions about:

          sf.ui.proTools.windows.whoseTitle.contains('Fade').first.buttons.whoseTitle.is('Fade Preset Toggle').allItems[0].elementClick(); ///0-4 is presets 1-5

          How can I select my preset 2, for example?

          Thanks!

          1. Hey @Rakel_Pascual sorry for the slow response been a busy week.

            So you're in the right place -- the confusing this often is that Javascript starts at 0 instead of 1. So the allItems[0] part of the line is the part you want to change. It's currently set for preset one IE number 0, in order for it to be Preset 2 you'll want the Number in the allItemes[X] to read 1 ... so the full line for Preset 2 would read :

            sf.ui.proTools.windows.whoseTitle.contains('Fade').first.buttons.whoseTitle.is('Fade Preset Toggle').allItems[1].elementClick(); ///0-4 is presets 1-5
            

            Also as an aside if you want I've templated this script and put it in my =CUTS= package in the store.

            Bests,
            Owen Granich-Young