Random word generator

Hello everyone. I’m trying to write a random word everytime I use my macro. I tried to copy and paste a name from a random name generator, but the macro always pastes the word that used the first time. Is there a way to add a random word? It doesn’t have to make sense, I just need a combination of 3-5 letters that it’s always different. I read some topics, but I don’t understand where I should add the code… I don’t have any experience with coding, so…

Thanks for your help!

What is a random name? Just any string, or a name like “John Doe”?

Any string like “aaaa”, “aaab”, “eudns”
Just a combination of random letters that never repeats

More simple to do and customizable changing part < 8 with the prefered number of characther you need

This is my macro code working like a charm :slight_smile:

{
“Name”: “Random_String_With_Array_Customizable”,
“CreationDate”: “2021-3-7”,
“Commands”: [
{
“Command”: “executeScript_Sandbox”,
“Target”: “var letters = [‘a’,‘b’,‘c’,‘d’,‘e’,‘f’,‘g’,‘h’,‘i’,‘j’,‘k’,‘l’, ‘m’,‘n’,‘o’,‘p’,‘q’,‘r’,‘s’,‘t’,‘u’,‘w’,‘x’,‘y’,‘z’]; var string = ‘’; for(var i = 0; i < 8; i++){string += letters[parseInt(Math.random() * 25)]}; return string;”,
“Value”: “v1”
},
{
“Command”: “echo”,
“Target”: “Random Value Is ${v1}”,
“Value”: “#shownotification
}
]
}

thank you! The macro ends with no errors, but it never show me the random word. I tried to add your code to a new macro just to test it. Here’s my code:

{
“Name”: “1”,
“CreationDate”: “2021-3-7”,
“Commands”: [
{
“Command”: “open”,
“Target”: “https://contacaratteri.it/”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=textinfo-ctrl-text”,
“Value”: “”,
“Targets”: [
“id=textinfo-ctrl-text”,
“xpath=//[@id=“textinfo-ctrl-text”]",
“xpath=//textarea[@id=‘textinfo-ctrl-text’]”,
“xpath=//textarea”,
“css=#textinfo-ctrl-text”
]
},
{
“Command”: “click”,
“Target”: “id=textinfo-ctrl-text”,
“Value”: “”,
“Targets”: [
“id=textinfo-ctrl-text”,
"xpath=//
[@id=“textinfo-ctrl-text”]”,
“xpath=//textarea[@id=‘textinfo-ctrl-text’]”,
“xpath=//textarea”,
“css=#textinfo-ctrl-text”
]
},
{
“Command”: “comment”,
“Target”: “type // id=textinfo-ctrl-text”,
“Value”: "a ",
“Targets”: [
“id=textinfo-ctrl-text”,
“xpath=//*[@id=“textinfo-ctrl-text”]”,
“xpath=//textarea[@id=‘textinfo-ctrl-text’]”,
“xpath=//textarea”,
“css=#textinfo-ctrl-text”
]
},
{
“Command”: “comment”,
“Target”: " // ",
“Value”: “”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “var letters = [‘a’,‘b’,‘c’,‘d’,‘e’,‘f’,‘g’,‘h’,‘i’,‘j’,‘k’,‘l’, ‘m’,‘n’,‘o’,‘p’,‘q’,‘r’,‘s’,‘t’,‘u’,‘w’,‘x’,‘y’,‘z’]; var string = ‘’; for(var i = 0; i < 9; i++){string += letters[parseInt(Math.random() * 25)]}; return string;”,
“Value”: “v1”
},
{
“Command”: “echo”,
“Target”: “Random Value Is ${v1}”,
“Value”: “#shownotification
},
{
“Command”: “comment”,
“Target”: “open // https://contacaratteri.it/”,
“Value”: “”
}
]
}

contacaratteri.it is a site that counts how many characters you wrote. I used it for trying the code because I needed a blank space

Your macro code is incomplete you do not add any command to type, add the command to type.

Your macro in this mode never working because have not any command to fill form.

… so I should write something like this?

"Command”: “type”,
“Target”: “var letters = [‘a’,‘b’,‘c’,‘d’,‘e’,‘f’,‘g’,‘h’,‘i’,‘j’,‘k’,‘l’, ‘m’,‘n’,‘o’,‘p’,‘q’,‘r’,‘s’,‘t’,‘u’,‘w’,‘x’,‘y’,‘z’]; var string = ‘’; for(var i = 0; i < 8; i++){string += letters[parseInt(Math.random() * 25)]}; return string;”,
“Value”: “v1”
},
{
“Command”: “echo”,
“Target”: “Random Value Is ${v1}”,
“Value”: “#shownotification
}
]
}

Read docs you unknow how use ui vision

https://ui.vision/rpa/docs