In Finder how to select folder by name not by mouse/keys

Hi
I have made a very simple Macro that opens (?) a specific folder on my NAS, but if my extra mac is online too it may not work, so I just wonder if I could use an IF-then-else statement looking for the foldername not the position in the finder window!
I want to connect to my NAS: OBAN2, and once there to the Folder; Music
Any suggestions?
GreyT
Open Music on NAS.kmmacros (6.8 KB)

So you are mounting the NAS share so that it appear as a folder in the Finder, yes? If that's the case, you should be able to use the Open a File, Folder or Application action.

One way to get the path to enter into that action is to drag the folder into the Terminal, and copy the path that is shown.

If you want to copy music files from the NAS to your Mac's music folder, there is a Copy a file action.

I hope that is a useful start but I suspect that there will be more work needed on this.

Thanks for you suggestion. It may not be exactly what I try to do. I only want to just mount the selected folder (Music on the NAS) so Finder will show this is a Network Drive (on my desktop). No files to copy or otherwise...
I have just found this splendid software FAF (Find Any File) and it is perfect to look for Files, or parts of files, and my macro is simply to reduce clicks :slight_smile:

1 Like

I don't currently use NAS, so cannot check this, but if you can find a reliable way to mount the directory (folder) in the Terminal, then running that same command in KM's Execute a Shell Script action should also work.

This article may be of use: How to Mount SMB Share from Command Line on Mac.

I expect that someone here will have hands-on experience of such things and that better advice will arrive soon. Let us know how you get on!

Yes, it's very good. Your macro could however perhaps have search built into it, if you wanted, using the unix find command?

Depending on your needs, you might also be interested in Swinsian, a music library application (far superior to iTunes/Music) which I understand does work well with NAS. The library information could be kept on your Mac, with the audio files remaining on the NAS.

In the If action, you can specify the path you're expecting using the Path condition. You can read about it here: condition:Path [Keyboard Maestro Wiki] This makes it easy to branch macro execution on where the path exists or not.

Also, I use NASs routinely and my NAS folders are mounted automatically on my Mac. I did this by going into the admin page of the NAS, choosing the file manager facility and configuring the folders of interest to be SMB shares; these can then be "seen" and mounted on my Mac. I also have some folders configured as AFS shares, and they behave the same as far as I can tell.

1 Like

Hmm its after my sunday lunch, not grasping all of you suggestions.

The manual approach:
After entering Shift Cmd K, I get a screen like this (I may have 3 Macs running besides my Mac Studio AND the NAS)

I want to mount the NAS Music folder as network drive. Solely for option of running FAF as clever search finder. This has nothing really to do with music as such. FAF will/may search any available network "Folders".

My NAS is a Synology +920 Unit. I use it mainly just for storage of Music, to be played on my HiFi via a Bluesound Node2i box. This part works perfect. "Music" is a shared folder on the NAS.

So... I am looking for a simple solution that will enable FAF to search "OBAN2/Music", no matter the number of Macs open.

For the time being I have found a workable solution, where I keep my original simple macro... I just renamed OBAN2 to _OBAN2 and then it will stay on top in finderview, and macro executes as wanted.

Still if there is someone out there that could suggest a solution, not really depending on the naming of folders it would be interesting
:sunglasses:

GreyT

It's almost always better to use "proper" actions to do things instead of trying to replicate what you do in the user interface -- as you've seen, it doesn't take much for the UI to be different to what your macro is expecting!

You can use the "Open URL" action to open a shared folder by setting the protocol to use as smb. You'll know you own network better than us, but something like:

image

...should do it (after you've reset your NAS's network name, of course!).

If the newly-opened window is annoying, add a "Pause Until..." to wait until it is there and then close it:

Putting that all together:

Mount Network Music Share.kmmacros (3.7 KB)

Image

Wauw Nige_S thats a fast direct solution, which is logical... and I have not encountered this option before...
It worked... and then it now want me to accept password by a click.

for some reason pressing enter will not work, but click on the blue button will. Guess it is simple to fix but how?

Just checked my own version which dont present me with User/PW option!!!

After you've filled it in the first time, is it remembered on the next run of the macro?

And try adding the username to the URL: smb://GreytAdmin@_OBAN2.local/Music

This change gives same response... somehow it may be outside the macro. Under normal use I log on once and it is remembered ny MAc

The floating box with Adgangskoder... is new to me... and since it will not react to pressing enterkey, something might be hanging... could it be that the macro is running too fast?

I think -- and hopefully someone else will leap in here -- that box is your OS offering to fill in the remembered password, perhaps requesting authorisation to do so. Click it and see!

And try turning off "Remember this password", if only for troubleshooting.

Are you by any chance running the new Beta OS?

Hmmm... I did this, used the manual key chain shift cmd K ... cmd O
and opened a different folder on the NAS no pw required

the I ran your macro and now it works like zippp (as long as there is already one shared folder on the NAS opne on my desktop, in finder.

turning off the remembered pasword is n use, and the I would have to enter it anyway.

Looking into it on finder, once connection has been made... I just wonder, possibly naive:
what is the differrence between
_OBAN2 (requires no pw)
and
_OBAN2.local(prompts me for pw)

It's only for troubleshooting purposes -- for some reason Keychain doesn't appear to be associating the correct credentials with the Share. But if missing out .local in the URL solves the problem, no need to worry.

.local means "use mDNS to try and find this host". Your Mac shouts out "Who here is called _OBAN2?" across your network and only your server responds, sending back its IP. Missing it out (probably) means your NAS is advertising itself via WINS or Bonjour -- "I'm over here if you would like to connect!" -- or you've local DNS and DHCP-provided search paths or similar. While it's the same machine in the end, the method of identifying it when connecting can be enough to have Keychain thinking it is different.

(There's a lot of hand-waving in the above -- maybe a networking expert will step in with a better answer!)

Now I understand the function of .local ... its "hey there, you with that look in your eyes"

what I have tried out was once the "Music" was open on the mac I made "a reference"
and got this Starwars warrior
Skærmbillede 2024-08-19 kl. 19.21.51

and if I then pushes out the "Music" icon on my desktop, the warior remains, and then... Tadaaaa... when I run your macro again it conludes succssfully witout asking me for at pw.

All this is interesting for me... and I dont really get it... well as long as a macro works its fine... and my brain asks me for the explanation :disguised_face:
so maybe someone out there in this Forum can 'enlighten' me?

in the meantime I will restart my Mac and see if the starwar guy is still there

GreyT

Well he stayed on, and dubblecllking this icon I may then select which of the NAS folders to open, and they do, NOT, needi a pw.

so far so good...
I gather this was the correct outcome to be expected of you macro... and then... why will it not work on my system

Anyway its time for a :coffee:
and to you I send you some Carlsbergs :beers: with thanks for the help and insights

GreyT

Until that happens I stay with the very basic solution, after I renamed the NAS folder 'Music' to '1Music' so it would come out on top. This saves me 5 arrow down steps :slight_smile:
Simplest version

During this proces I found out that the NAS accepts the charachter '_' and sorts accordingly... BUT the indexing system on the Bluesound system does not. Hence the 1Music and not _Music

Now it is time to listen to my music and also let FAF search 1Music,(which was the startingpoint of it all)
:beer:

"one more thing..."

When I started with KM I used a lot of mouse/position clicks..., later with super help from many users on this forum I have ventured further :sunglasses: and somewhat out of frustration with the GreytAdmin logon nonresponse (just in this case) I have combined the old with the new into this, which works 'hands-off' once the shortcut have evoked it.

Mount network 3

I have an unfounded notion that the first Action: Open URL... is running too fast by itself for my system to follow, but at least the rest gets along after the short delay used.

So I am happy now... and still curious about trimming possibilities
:disguised_face: