Hey Tom,
Welcome to the forum!
My best guess is that you don't have a complete directory chain – e.g all folders must exist all the way to the target folder.
The way around this is to use the -p
switch for mkdir
as I do in my example macro below.
This creates the enclosing folders as necessary.
Note too that I've double-quoted "$KMVAR_nameStr"
. While these are only necessary if you have spaces in the name-string, it's a good habit to get in to – because somewhere down the line you'll get bitten if you don't have them.
This macro should just work out of the box, but do let me know if you have any problems or questions.
-Chris