Keyboard Maestro 8 introduces a new Split Path action.
Basically, this is like a pre-configured Search using Regular Expression action which takes a path and splits it in to its component parts:
- The parent path
- The file name
- The base file name (ie, without the extension)
- The extension
You can save any of these you are interested in into variables. If you only want one, you can still use the Get File Attribute action, but especially if you want more than one part of the path, this new action is a clearer and simpler way to get the details.