It is because there is no return after your last line so, no return to seach and replace. Your Variable is like this:
link 1↩
link 2↩
link 3
Depending on how you are getting those lines into the Variable, the simplest thing might be just to append the variable with a single before doing the search and replace.
I'm using the FOR EACH action. Shouldn't it add the return after the last line (link 3) as well?
Thing is, what if I want to add other stuff before and after the original line?
For example, my particular case is something like this
[[[
%Variable%Local__VarName%
]]]
\r
So I would have something like this
[[[
link 1
]]]
[[[
link 2
]]]
[[[
link 3
]]]
(extra line after this last one)
If I use the action you shared, I would have an extra line after link 1, link 2, link 3, which is not what I need to do. You know what I mean?
Also, check my previous reply where I explain what I'm trying to achieve using "FOR EACH". The lines can't be right after the variable line. I need to replace the line with something else and only then, add the new line at the end
It all depends on how you are actually using that Action to assemble your variable. If you are doing something like the below yes, it would add a return to each line of the variable, including the last line.
I didn't know about the %Return%. Good to know. Thanks
I guess I know what's happening. Since I'm testing this macro, I am displaying the results in a window. For some reason, that window doesn't add the extra line at the bottom, but when I set the clipboard to the variable and then paste the results into TextEdit, for example, it adds the extra line at the bottom, even when I use \r
So it seems that the issue is related to how the display window shows the results.
If your master variable is changing by having more lines added or deleted from it, I would suggest not adding your double returns until you need them.
Keep your master variable as simple as possible, just the data on lines or separated by another character and only add in the double returns (using a different variable) at the point you need them in your Macro.