I have found two filters that do not behave as expected: Base Name/Basename and Delete Path Extension.
According to the doc for the Basename filter (note that it is misspelled in the KBM UI and if you search the doc for "Base Name", as it's called in the UI list in the Filter action, you won't find anything) using that filter should remove the file name extension. So should the Delete Path Extension.
But if the filename has a space before the extension (tested with [space].txt and [space].rtf), then the extension is not removed.
I can work around this, but it's not the expected behavior. The OS (Finder) recognizes the files as their type by the extension, despite there being a space in the filename, and it opens them with the appropropriate app. The space does not give Finder a problem, and it shouldn't bother KBM either. (IMHO)
As there are various textual representations of file paths (+/- quoted, +/- escaped, +/- tilde expanded, etc etc), this kind of filter inevitably needs to be defined over a standardized representation.
Fortunately, you can prepare your filepath for a filter by standardizing it first (using Keyboard Maestro's Standardize Path filter):
I think most of these confusions about the relationship between an actual Path and a textual representation of it are well fixed by the Keyboard Maestro Standardize Path filter.
Expand disclosure triangle to view JS source
// filePath :: String -> FilePath
const filePath = s =>
// The given file path with any tilde expanded
// to the full user directory path.
Expand disclosure triangle to view AppleScript source
use framework "Foundation"
-- filePath :: String -> FilePath
((current application's ¬
NSString's stringWithString:s)'s ¬
stringByStandardizingPath()) as string
The behavior was pretty consistent and I tried lots of Display Text In Window actions before and after to verify what was happening.
AND I figured it out.
The filename is generated by an Execute Shell Script action and the script returns two values, separated by a newline. I was attempting to apply the Base Name filter to the extracted variable value, not just a filename. So I suspect that
"Base Name" is the label for the filter choice in the UI. "Base Name" does not appear in the User Manual or Wiki, but "basename" does. The command basename is a standard UNIX command and can be used in MacOS from a terminal or Shell script, which is probably why it made it into the Manual that way.
Whatever you think the proper spelling should be is fine with me, two words or the UNIX command, I don't care. My concern is that the UI says "Base Name" and I when I search for an explanation of what that filter does, I cannot find "Base Name" in the Manual or the Wiki. That, to me, is an error, whether you call it a misspelling, a typo, an omission, or whatever, I don't care. It's an error because it's confusing and does not help the user find the info they need.