Issue with changing global macro

I have this macro that is supposed to change a global macro that's set to just Q to then being A.

It just doesn't work. But then the same macro, if I change it to set it to Ab, it works.

This doesn't work:

(it's showing empty, because the variable is set to Q at the beginning of the macro)

These work:

Is this a bug?


EDIT: I have no clue what's going on, but I just can't make this macro to change the global variable at all! What's going on??

This is definitely driving me insane...
If I use a different word like ABC as the replacement, it works :exploding_head:
It refuses to work if I use a word that's being used such as Answer.
If my Switch already checked if the variable was Question, why does it matter which word I'm using, and if it matches another word I want to use?
What am I missing here...?

I assumed that the Switch, once it matches one of the "rules", executes the actions and leaves the Switch action, right? So, even if I change it to Answer, the second rule doesn't match, because it doesn't even check it, right?

According to the documentation:

Under no circumstances will actions from more than one section be executed - that is, execution does not “fall through” to following sections as happens in some languages.

Summary

+++Copy ChatGPT Conversations (process).kmmacros (27 KB)

The issue with your macro is that you're attempting to "Retry This Loop" within a "Group" action (AFAIK, because the Group action is not a “loop”, "Retry This Loop" will retry the entire macro instead). @peternlewis can confirm if this is the expected behavior.

I've modified your macro to use an UNTIL [infinite] loop instead. Additionally, I've added a few notifications to confirm that the Switch logic is functioning correctly.

+++Copy ChatGPT Conversations (process) (MODIFIED).kmmacros (26.8 KB)

Screenshot

1 Like

I guess when I tested it, I wasn't doing the right testing, and it seemed like it was working with the group.

I will check your macro and see how it goes. Thanks

I just tested my macro by replacing the group with the Until action and it works.
It was indeed the issue with using the Group and the Retry This Loop.

Appreciate you taking the time to test this and sharing your feedback. It was driving me crazy!

1 Like

For these purposes, any of the loop actions (For Each, Repeat, Until, While) are considered to be loops. Group is not considered to be a loop (use a Repeat 1 Time if you want to be able to Continue or Retry or Break from a single list of actions that is otherwise executed once).

The behaviour of the Retry, Continue, or Break From Loop actions is undefined if they are not within a loop and is subject to change. Currently the surrounding macro itself is considered a loop.

2 Likes