Trouble Detecting Network Drive Is/Is Not Mounted

I'm having some trouble with an If statement detecting whether a network drive is mounted or not. It keeps returning True whether the drive is connected or not. What am I doing wrong?

Talus is a Windows computer on the my same home network with three shared drives--F, M, and D. I have sync operations that run at night or on-demand, but I need to first determine if the correct drive is mounted.

I've tried setting the name to F, the actual drive name that appears in Finder, and to "Talus," the server name.


Apparently the Share function within KM Editor did not automatically upload screenshot and macro. Sigh.

SYNC - Nightly w- MM - Archives- The.kmmacros (4.3 KB)

Why have you placed the display ‘true’ action in the false section of the IF action? Surely it should be in the ‘true’ section?

As a consequence, if Talus is mounted nothing will be displayed whereas if it is not mounted “True” will be displayed. BTW - you should use the volume name and not “Talus”.

Thanks. Yes. I uploaded a screenshot in the middle of troubleshooting. I had just moved the Display Text into the false area for testing. As I said, it shows True no matter where the Display Text action appears, and no matter whether I put the drive name or server name in the test field.

Update: It intermittently works and doesn't work with the same macro above. I'm starting to think there might be something in the way the Mac and Windows are talking to each other more than a KM issue.

I've just tested your macro on my Mac and it correctly tells me whether an external USB drive is mounted or is not (after ejecting it).

I've also tried it with one of my NAS shares


and it is correctly identified as mounted or not.

One thing I noticed was I had to introduce a short delay between the Open URL action and the IF action that follows. That could be linked to your seeing it work intermittently. I used a 5 sec Pause action. Perhaps you might want to try a pause although you'd need to experiment with the length of the delay.