No internet connection
  1. Home
  2. How to

Logic Pro X: Browser Macros

By Josh Ha @Josh_Ha
    2024-10-12 16:21:03.619Z

    Hi everybody,

    I was wondering if there is a way to navigate between folders in the Logic Browser.
    I want to create different macros which should open different Bookmarks.

    Thanks in advance
    Josh

    • 4 replies
    1. Kitch Membery @Kitch2024-10-21 18:28:25.834Z

      Hi @Josh_Ha,

      Can you provide more information on what you'd like to achieve by navigating between folders in the Logic Browser?

      Also, if you could provide a screenshot(s) of the browser you are talking about that would be very helpful.

      Thanks in advance.

      1. JJosh Ha @Josh_Ha
          2024-10-29 12:26:25.447Z

          Hi Kitch, I'm talking about the All Files Browser tab. I'm using bookmarks quite a lot. So would be very helpful to put some folder paths on sound flow macros. But not sure if this is possible?

          Thanks in advance!

          1. Kitch Membery @Kitch2024-11-04 23:48:33.943Z

            Hi @Josh_Ha,

            Try this script with the "All Files" tab visible.

            function selectBookmarkFolder({ name }) {
                const logic = sf.ui.logic;
                logic.appActivate()
                logic.invalidate()
            
                const browserGroup = logic.mainWindow.groups.find(c =>
                    c.groups.whoseDescription.is("All Files").first.groups.whoseDescription.is("All Files").first.exists
                );
            
                const allFilesPanel = browserGroup.groups.whoseDescription.is("All Files").first.groups.whoseDescription.is("All Files").first;
            
                const allFilesPanelHeaderButtons = allFilesPanel.groups.allItems[1].buttons;
            
                const getButtonByName = (name) => allFilesPanelHeaderButtons.find(btn => btn.getString("AXHelp") === name);
            
                const bookmarksBtn = getButtonByName("Bookmarks");
            
                // Click "Bookmarks" button
                bookmarksBtn.elementClick();
            
                allFilesPanel.invalidate();
            
                const allFilesPanelTable = allFilesPanel.groups.first.scrollAreas.first.tables.first;
                const rows = allFilesPanelTable.children.whoseRole.is("AXRow");
            
                const getRowByName = (name) => rows.find(row =>
                    row.childrenByRole("AXStaticText").first.value.invalidate().value === name
                );
            
                const targetRow = getRowByName(name);
            
                // Double-click target Bookmarks folder row
                targetRow.mouseClickElement({
                    relativePosition: { x: 5, y: 5 },
                    clickCount: 2,
                });
            }
            
            selectBookmarkFolder({
                name: "AUDIO LIBRARY",
            });
            

            Let me know how it goes! :-)

            1. JJosh Ha @Josh_Ha
                2024-11-11 12:14:27.379Z

                awesome - thanks Kitch!
                Gonna test this week.