No internet connection
  1. Home
  2. How to

Finder/Logic Pro X open and select menu item

By Alex Oldroyd @Alex_Oldroyd8
    2022-01-04 23:40:17.763Z

    Hi all

    Wondering if there is a better way to select an item from the menus shown in attachment. It is the Save Patch As dialogue. Behaves very similarly to Finder. So far I can only make it working using mouse click relative to UI Element.

    Thanks

    Alex

    Solved in post #5, click to view
    • 5 replies
    1. Kitch Membery @Kitch2022-01-07 21:56:46.186Z

      Hi @Alex_Oldroyd8,

      Once the "Save Patch as..." Window is open you can use the following function to navigate to a folder;

      function setSavePatchAsDestination({path}) {
          const logic = sf.ui.app("com.apple.logic10");
          const savePatchAsWindow = logic.windows.whoseTitle.is("Save Patch as…").first;
      
      
          //Shortcut for opening the "Go To Folder" sheet.
          sf.keyboard.press({ keys: "cmd+shift+g", });
      
          //Wait for the "Go To Folder" sheet.
          savePatchAsWindow.sheets.first.elementWaitFor();
      
          //Enter the path into the the text field 
          savePatchAsWindow.sheets.first.textFields.first.elementSetTextFieldWithAreaValue({
              value: path,
          });
      
          //Press return key.
          sf.keyboard.press({ keys: "return", });
      
          //Wait for "Go To Folder" sheet to close
          savePatchAsWindow.sheets.first.elementWaitFor({ waitType: "Disappear" });
      }
      
      setSavePatchAsDestination({
          path: "/Users/kitchmembery/Music/Audio Music Apps/Patches/Audio",
      });
      

      Just change the path property to the folder you want to save the patch to.
      Rock on!

      1. AAlex Oldroyd @Alex_Oldroyd8
          2022-01-09 00:22:20.169Z

          Amazing!! Just seen this. Thanks, Kitch!

          1. In reply toKitch:
            AAlex Oldroyd @Alex_Oldroyd8
              2022-01-09 00:38:33.312Z

              Hi Kitch

              I can't work out how to set the path property. Do i type at the top eg:
              var path =."/Users/alexoldroyd//Music/Audio Music Apps/Patches/Instrument/03 Bass/07 Bass Guitar"

              Or do I replace the word funtion with the above?

              Thanks

              alex

              1. Kitch Membery @Kitch2022-01-09 02:29:17.248Z

                Hi @Alex_Oldroyd8,

                Step one would be to get the exact path of the folder you want to navigate to in the "Save Patch as..." window.

                To do this;

                • Open the "Save Patch as..." window.
                • Navigate to the folder you want to save the patch in
                • Right Click on the Patch folder and select "Show in Finder"
                • Once the folder is shown in the finder, right-click on it while holding the option key and select "Copy "YOUR FOLDER NAME" as Pathname" and the path will be copied to the clipboard.

                Once you have this update the path property of the setSavePatchAsDestination() function call by pasting the folder path stored in the clipboard like this;

                setSavePatchAsDestination({
                    path: "PASTE HERE",
                });
                
                ReplySolution
                1. AAlex Oldroyd @Alex_Oldroyd8
                    2022-01-11 13:01:56.404Z

                    Thanks for this, Kitch. Got it working :)