I’ve noticed a discrepancy between how Switch Case and If Then interpret whether the System Clipboard contains an image.
At least on my system the Switch always seems to return False, regardless of whether the clipboard has an image or not.
KM version: 11.0.3
macOS Sequoia 15.3.2 (24D81)
M1 Max Macbook pro
SystemClipboard has image — Switch and IF different result.kmmacros (7.8 KB)
2 Likes
The Switch or Case action as implemented currently only deals with plain text.
Which is not what the conditions imply or what is documented, so I will have to take a look at it and decide whether the documentation or the implementation is more correct.
6 Likes
Interesting! Did not know that plain-text-only was a trait of the trusty Switch/Case. Very useful knowing this!
I know that allot of us would absolutely love for the Switch/Case to have the full condition set from the If/Then. But I know that allot of us also take advantage of the Switch' speed as compared to the If/Then. And if the plain-text-only is a premise for this speed it would not be as clear cut.
Best of both worlds would of course be awesome. But I have absolutely no way of understanding the limitations and challenges of a dreamt up feature addition like this. (And therefore it is really only silly of me to think out loud if maybe a plain-text-only action setting could make it possible for the Switch to be built out further? Or maybe implementation as two different actions? – One Switch/Case 'LITE' (built for speed), and Switch/Case 'FULL' (with the full condition set from the If/Then)
It doesn't really make sense for the Switch action to have the same conditions as the If/Then action because the whole thing with the Switch action is that there is a single source thing that is compared against a set of possible values.
It's not really about performance, its about simplify - you are choosing the one thing that you are comparing to a set of values.
It's not impossible that I would Implement an If/Then/ElseIf action, but that's a lot of complexity to the action just to avoid nesting (which admittedly is worth avoiding).
1 Like