I fear this is a very basic question but I've been searching through the forums and wiki for over an hour and I'm starting to doubt my own sanity. I'm sure this is simple but I can't get my head around it.
Goal
I want to copy three sets of usernames and passwords from a webpage (that has a fixed layout) and assign each username and pairing to a hotkey so I can enter each into a website with a single key. (eg. Key 1 = first user, Key 2 = second user etc.). That pasting macro is working fine. It's just a combination of pasting %Variable%demoUsername1% etc along with some tabs and enters.
Where I'm Stuck
I can't for the life of me get a loop working. This is where I'm at in terms of the first user:
I've got the first username and password as the variables demoUsername1 and demoPassword1. Great! But how do iterate through the rest so they become demoUsername2, demoPassword2 etc.? My variable userCredentials has all the text I need.
My basic understanding regex is telling me the syntax is right (regex101: build, test, and debug regex ) but the KM looping has defeated me. I'm sure the answer is simple but I've got myself into a deadend.
Any help would be massively appreciated. I think I've read too many forum posts with more complicated requirements that I've confused myself.
Macros are always disabled when imported into the Keyboard Maestro Editor.
The user must ensure the macro is enabled.
The user must also ensure the macro's parent macro-group is enabled.
System Information
macOS 13.3.1 (22E772610a)
Keyboard Maestro v10.2
Just a couple notes:
Typically you'd want to use local variables in a macro like this. Click here for more information.
I inserted some Group actions (in red) that you can obviously disable or delete. I inserted those actions using a macro I shared elsewhere on the forum).
My guess of the input format was close enough that the parsing logic did not have to change. But in this version I inserted the actions that you included above. Note that they are initially disabled, but after confirming that the data is parsed correctly you can enable that group.