Some macros only work as expected after the second run

This is quite regular and I wonder if other people experience the same.
Sometimes when I run a macro, it doesn't run with the changes I made, unless I run it a second time.
For example I have a simple macro with a variable and I'm using the Search and Replace action, but when I make some change to the text that will replace the current string, it shows me the same thing as the one before the changes. When I run it a second time, them I am able to get the new changes (replacement).
This is not only happening with this action. I experience that with other actions as well.
It feels like KM gets stuck in the previous state and only updates when I run it a second time.

For example let's say the variable is
Link 1
Link 2

and I want to replace "Link" with "URL".
When I change the action from Link to URL, when I run the macro I get:
Link 1
Link 2

When I run it a second time I get:

Anyone else experience this?

One possible explanation for this is that when you trigger the macro the first time, KM is in the process of saving your macros from the last edit. So it doesn't actually get triggered. This happens to me all the time. I just learn to live with it and recognize it when it happens.

One way to prove this is to open the KM Engine log and see if the macro actually triggered twice. Another way is to open the Debugger and see in the Debugger if the macro was actually triggered twice.

If neither of those things solve the problem, we may need to see your macro, especially the trigger.

1 Like

Ok so at least I know it's not just me/my computer.

This happens even when I use the RUN button at the top, inside KM, without any trigger set up.

But it's all good. Just like yourself, I got used to it and if I don't get the results I expected, I always run it a second time just in case.

Thanks for confirming this.