Thanks for the response - very strange it's working for you - you're not doing anything different what I did, and expected to work!
I see the double forward slash in your first example - I don't have a trailing slash on my first path variable, but even so, it should work (especially as you say how "forgiving" it is for you!)
I this working macro I'm making CERTAIN I create a correct file path.
You should not be concerned here with what Keyboard Maestro or the macOS will tolerate. You should be concerned with how to construct a correct file path on Unix.
As you can see I've disabled the Create New Folder action in favor of a Display Text in Window action.
This lets me completely visualize the file path I've built, and I can test it in the Terminal or a BBEdit shell worksheet (my general preference for this sort of thing).
Here is the created path:
/Users/chris/test_directory/KM_TEST/Test Folder
It will NOT work in a normal shell environment, because of the embedded spaces. These need to be quoted or escaped.
Quote example 01:
'/Users/chris/test_directory/KM_TEST/Test Folder'
Quote example 02:
/Users/chris/test_directory/KM_TEST/'Test Folder'
Escaped example 01:
/Users/chris/test_directory/KM_TEST/Test\ Folder
These methods MUST be used IF you're working in a shell environment.
BUT — Keyboard Maestro understands path strings with spaces in them and will escape them for you.
The big issue for you in this task is to make certain you've properly divided the nodes in your path with a forward slash.
To see if a path string works you can create your file or folder in the location you want it and then use ⌘⌥C in the Finder to copy the item's path string.
If that matches the path string you've created in your macro then you're good to go.
Thanks all - I just got back to having another look at this.
I put an Alert displaying the exact same concatenation string as in the Create Folder action, and the path/folder variables were expanded and displayed correctly.
I then re-enabled the Create Folder action, and it’s creating the destination folder correctly now, with no changes to the macro steps.
So I was doing it correctly, it just seems that KM had got into a weird state where it wasn’t expanding the variable correctly. Sounds like a bug to me - if it happens again, or I can lock down a set of steps to reproduce, I’ll post back.
The new folder macro doesn't work for me in 10.13.6, same error as rlivingston's solution above
2019-11-07 20:40:43 New folder /Users/me/Downloads/test_directory/KM_TEST/Test Folder failed with error Error Domain=NSCocoaErrorDomain Code=4 "The file “Test Folder” doesn’t exist." UserInfo={NSFilePath=/Users/me/Downloads/test_directory/KM_TEST/Test Folder, NSUnderlyingError=0x604000659230 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} In macro “Create New Folder” (while executing Create New Folder “%Variable%local_RootPath%/%Variable%local_FolderName%”).