Splitting File System Paths

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.

9 Likes

This is one of my favorite new features! It’s simplified dozens of my macros and I use it all the time. Thanks!

Can I plug a variable in as the path? For example, can I copy a file path and then create a variable from the clipboard and then split the file system path from there into other variables…

Absolutely. You can even skip the "create a variable from the clipboard" step and split the clipboard's contents directly:

Wouldn’t be nice to display the full content of variables on mouse hover? Like tools showing up tooltips.
Thank you.

No!

But I'd go for Option-Hover.  :wink:

-Chris

2 Likes

Option-command or nothing ! :wink: