Finder selection in the Import Audio (or similar windows)

I have a problem with the batch importing the files with the name containing some letters.
The problem lies in the fact the Finder tends to search the whole Mac instead of the selected folder if it's executed from the other app. Like File/ Open dialogue. There is no option that can change it.
Currently I'm pressing tab to get to the search field, type the letters, then ask KM to click on Video and Audio folder (I have the same folder structure for the every Nuendo project) and after that select all and press OK.
But it's not stable. For instance, I need to import the file containing MX in the name. And as it turned out, I have a lot of files on my SSD having MX in the name. So, the app should wait until the search results get populated, as the selected folder (Video and Audio in my case) field is inactive, not clickable until that. And it's not the same amount of time every time.
I can of course import them one by one, opening File/ Import Audio dialogue for the every file but it's slow.
The question:
Is it possible to make the selection in File/ Import Audio (or any similar) dialogue with the KM command? Like tell the paths of the needed files bypassing search field? And not doing it one by one?

  1. File/ Import Audio
  2. Finder window gets opened
  3. Some command make the needed file to be appeared and selected in this window.
    Here is the part of the macro I use to import the audio:

Import Audio.kmmacros (25.5 KB)

Seems the Apple Script should do that, but AI can't help me with the correct code :-). It make the code which selects the files in the finder window outside of the app.

Google Gemini created the script

tell application "System Events"
	tell process "Nuendo"
		-- Wait for the window to appear (adjust timeout as needed)
		repeat with i from 1 to 20 -- try for 20 seconds
			if exists (window "Import Audio") then exit repeat
			delay 1
		end repeat
		
		tell window "Import Audio"
			tell scroll area 1 of splitter group 1
				tell outline 1
					set rowList to every row
					repeat with aRow in rowList
						-- Get the name from the static text within the row
						set itemName to (value of static text 1 of UI element 1 of aRow) as text
						if itemName contains "DX" and itemName ends with ".wav" then
							-- Select the row
							select aRow
						end if
					end repeat
				end tell
			end tell
		end tell
	end tell
end tell

But it does nothing.

So, are you saying that from an App's open file dialog box you want to first go to a specific folder where you have your files saved and then search within that folder?

There are ways to do that by incorporating the Mac's standard ⇧⌘G shortcut (go to a specified folder) in a Macro. Or you can use a great plugin that @noisneil has made:

1 Like

This could be difficult to do reliably.

I'm assuming you can't reorganise your projects so the MX files are in one subfolder, DX in another, etc.

Does Nuendo import correctly if you select an alias of the file you want to import? If so you could create a temporary folder containing aliases of all "MX"-named files in your project, then bring up the "Import" dialog, navigate to the temporary folder, ⌘A, and import everything you need.

1 Like

Thanks.
I am more interested to selected the files based on name criteria after the navigating.

No, the case is: I receive the same files for the every projects. Video file and tree audio files if it's a TV show episode or a few video files and and a few three audio file sets for the each videos. And the task it just select the folder and let macro to place them into the project onto the certain tracks.
That's why I need to navigate to the specific folder and select the specific files to import. I can use ⇧⌘G but I need to select files then.

The problem is the selection in this window with no use of the search field

I can select one file using


but how to select all files with DX or MX?

If you have the multiple selected files in the Finder and specify the App to open them (you haven't named the App you are using) do they get imported into the App?

For example, assuming you get the list of files into a KM Variable:

If that works then you could replace the open dialog part of you Macro and you would have more options.

1 Like

It's Steinberg Nuendo. No, unfortunately it opens only npr files. Nuendo Project files.

None of which stops you from either:

  1. Reorganising the "Video and Audio" file with a sub-folder for "DX" files, another for "FX" files, etc
  2. Adding "MX alias", "DX alias", etc folder and putting aliases of the files into the right "alias" sub-folders
  3. Creating a temporary folder in /tmp and putting aliases to the required files in there

All of these can be done as part of your processing macro.

In each case that gives you a much simpler Import -- ⇧⌘G to go to the correct folder, ⌘A to select all the files or aliases, hit the "Import" button.

You will find it difficult to reliably select files in the way that you are trying to do at the moment -- there's simply too much that can go wrong. So side-step the problem entirely by using one of the methods above.

2 Likes

I will try it out.

I have found the reliable solution.

I can use the paste function in Nuendo to paste the file to the selected track. So I can do:

This macro doesn't contain the track selection but it's not complicated.

1 Like