Finding DOCX files inside a multiple-level folder hierarchy

Hey Steve,

So you're trying to use a text-token in a shell script.

The text token would be %Variable%Path_Stub% NOT %Path_Stub%, but that is not the correct syntax for a shell script.

KMVAR_YourVariableName is correct.

So:

mdfind -onlyin "$KMVAR_Path_Stub"

* Use quotes to make certain spaces are correctly treated in path strings in the shell.

Keyboard Maestro understands $HOME-based paths (e.g. ~/Downloads), but you can run into issues when a path contains spaces and you pass a home-path to the shell.

You can't quote the home part of the path – you must:

~/Downloads/'my folder name with spaces'/

Or you can escape the spaces of course.

The simpler way to handle this in Keyboard Maestro is:

-Chris

1 Like