How to make a keyboard sequence repeat several times ?

On a specific website I have developed a sequence of keystrokes and text pasting which populates a form without any user input. So far great and it works as expected.

Question: How can I make this sequence repeat now (for example) 5 times ?

I know I could just copy and paste the existing steps below the existing ones and make the sequence longer, however if I need to change the content of the pasted text for example I would need to do this multiple times as well. I am sure there is a more elegant way ?!

Can you tell me how it works ?

Basically: "Repeat the keyboard sequence launched with the command "yyx" for 5 times"

Thank you so much !

I haven't tested this, but if you make a named trigger out of your key sequence, you should be able to repeat that trigger 5 times.

Ah, but you want to interrupt the macro, change something and then continue? Mh, I don't think that's possible. Anyway, I don't know how to do that.

No, I don’t want to change the macro. I can use it for several days and then (maybe) just change a single item and use it again for some days. Repeating that sequence several times in a row is the only thing I am looking for.

instead of assigning it directly to the trigger, create a named trigged (in the automations, named & other triggers section ) and then use e.g. the "run real javascript" action like this

(async ()=> {

for(let i=0; i<5; i++) {
   await callBTT('trigger_named', {trigger_name: 'YourNamedTriggerName', wait_for_reply: true});