I have a variable with the text lines:
link3
link1
link2
If I use the filter "Sort Lines", I get (as expected):
link1
link2
link3
But when I use Reverse Lines, I get this:
link2
link1
link3
Is this a bug or am I missing something?
Also, @peternlewis, the manual could use an update here (manual:Filters [Keyboard Maestro Wiki]). It says Sort, reverse sort, or shuffle lines
and maybe it could have the exact terms such as Sort Lines, Reverse Lines, or Shuffle Lines
I think it would be clearer and even for SEO purposes it would help Google find this.
Reverse lines does exactly that; it reverses then. So in this case, the first line becomes the last, and the last becomes the first. I agree that the wiki entry is confusing since it says “reverse sort” which is not actually the case, and the action itself does not say that, but rather “reverse lines”.
I see. So basically it "mirrors" the results, right?
So if instead of 3 lines I have 5, then 2 becomes 4 and 4 becomes 2, 1 becomes 5 and 5 becomes 1. Correct?
If that's the case, is there a way to Reverse Sort?
I don’t think I quite understand your example, but it doesn’t add lines, if that’s what you mean by “instead of 3 lines I have 5”... it just reverses the order of the existing lines.
If I understand your meaning by “Reverse Sort”, then it’s just a matter of reversing the lines, and then sorting them. See the example macro, and again, apologies if I’m not following what your issue is. I think I need more coffee.
EDIT: the example macro has the correct order of actions, sort and then reverse. I just wrote it wrong in my comment above. Off to get that coffee now
My original example had 3 lines, right? So when you said that it reverses the first and last lines, that could mean that it reverses ONLY the first and last. So if the variable was
3
1
2
it would become
2
1
3
but if I had 5 lines instead:
2
5
1
3
4
it would be
4
5
1
3
2
(only reversing the first and last lines)
That's why I said it mirrors the results (or as you said, reverses the order, without sorting), instead of "first and last" lines. The way you phrased it could be interpreted as ONLY reversing the first and last lines (regardless of the number of lines) instead of mirroring the lines. Does it make sense? If not, don't worry. It's not relevant haha
And yes, sorting them first and then reversing is what I want. Basically, just sorting them alphabetically Z-A instead of A-Z.
I wish KM would have this as an option. It seems a bit counterproductive to have an extra action to do something that could be done in a single action. We could have both Reverse Lines and Reverse Sort.