No internet connection
  1. Home
  2. How to

Navigate to a specific folder in a bounce dialog box in Logic

By Matt Hennessy @Matt_Hennessy
    2022-06-23 05:16:20.984Z

    Hey all,

    fine tuning some things here and being able to script navigating to a specific folder in a session would be very useful. For example I understand that

    var folder = "...";
    
    sf.keyboard.type({ text: folder });
    
    sf.keyboard.press({ keys: 'enter' });
    
    

    Will move me to exact folder path I type into the "..." But what if I want to move to the Audio Files folder of the open session in LPX.. Or perhaps the bounce folder?

    Is that possible to script?

    Thanks

    Matt Hennessy

    • 4 replies
    1. samuel henriques @samuel_henriques
        2022-06-23 23:20:37.399Z

        Hello Matt,
        I think Kitch has your solution, check it out.
        How to navigate to current session folder in Logic. #post-6

        1. samuel henriques @samuel_henriques
            2022-06-23 23:30:54.676Z

            Not sure if something has changed on OSX. For Kitch' code to work for me I need to change:

            const filePath = logic.mainWindow.getString("AXDocument").slice(7, -1);
            

            with:

            const filePath = logic.mainWindow.getString("AXDocument").slice(7, -1).replace(/%20/g, " ");
            

            Let me know if it works for you.

          • M
            In reply toMatt_Hennessy:
            Matt Hennessy @Matt_Hennessy
              2022-06-25 00:55:55.686Z

              Well that opens a folder in users/music in the finder, but what Im looking to do is navigate to a folder in the "Save As" window. I realize now I failed to mention that in the OP... my bad.

              So for example when I bounce to disk some scripts i need the file to go the audio files folder and some the bounces folder.. I want to automate the selection of that folder in the save as window.

              Thanks

              1. M
                In reply toMatt_Hennessy:
                Matt Hennessy @Matt_Hennessy
                  2022-06-25 01:22:39.571Z

                  @samuel_henriques I figured it out tho thanks to you! Combining the 2 scripts works. This script from the save as dialog box takes me where i want to go. Thank you!

                  const logic = sf.ui.app('com.apple.logic10');
                  const filePath = logic.mainWindow.getString("AXDocument").slice(7, -1).replace(/%20/g, " ");
                  const folderPath = filePath.split('/').slice(0, -1).join('/');
                  const sessionName = filePath.split('/').slice(-1)[0].split('.logicx')[0];
                  const fileExtension = '.logicx';
                  
                  
                  //Goto Bounces Folder//
                  sf.keyboard.type({ text: folderPath + '/Bounces/' });
                  
                  
                  sf.wait({
                          intervalMs: 250,
                          });
                  
                  sf.keyboard.press({ keys: 'enter' });