0
VERSION BUILD=844 RECORDER=CR
URL GOTO=https://EXFESDGT.org/edit
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:editForm ATTR=ID:customURL CONTENT=ASHFUO3ENFO2N32O
TAG POS=1 TYPE=BUTTON FORM=ID:editForm ATTR=TXT:Save<SP>Changes
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:editForm ATTR=ID:customURL CONTENT=ASF23FS34
TAG POS=1 TYPE=BUTTON FORM=ID:editForm ATTR=TXT:Save<SP>Changes
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:editForm ATTR=ID:customURL CONTENT=pas3FS34
TAG POS=1 TYPE=BUTTON FORM=ID:editForm ATTR=TXT:Save<SP>Changes
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:editForm ATTR=ID:customURL CONTENT=ksk3FS34
TAG POS=1 TYPE=BUTTON FORM=ID:editForm ATTR=TXT:Save<SP>Changes
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:editForm ATTR=ID:customURL CONTENT=3f3ds23FS34
TAG POS=1 TYPE=BUTTON FORM=ID:editForm ATTR=TXT:Save<SP>Changes 

Whenever I try to run this macro in the specic website it just applies until the first line after loading the edit page. I want it to loop changing the custom url saving & reloading the page

Itchydon
  • 2,572
  • 6
  • 19
  • 33
Taranjeet Singh
  • 35
  • 1
  • 1
  • 5
  • I can see that you are adding the content as "ASHFUO3ENFO2N32O" inside the editform, then you are clicking the save changes button, then this keeps on happening again and again. Could you please tell me correctly what order you want this to happen. Currently you only add content to editform and click save changes 5 times – Naren Murali Aug 08 '17 at 17:46
  • the thing is i want to add random 20 or less char string as random input to that field with saving each time i change the old string .can be any number of time lets assume 20 . – Taranjeet Singh Aug 09 '17 at 19:13

1 Answers1

0

Updated Answer:

Based on the new requirements I have modified the code, I dont know where to add the wait 1 you had mentioned.

I have chosen an awesome function in the post of Nimphious the link to this function is here

So you need to set three variables to setup the function, The variables need to written in the eval function, refer to the imacros code below, the details explanation of the variables is shown below:

1. characters:

if characters is set to the below character only those characters under the parameter are set.

'a' -> 'abcdefghijklmnopqrstuvwxyz';
'A' -> 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
'#' -> '0123456789';

2. Max:

It represents the maximum length of the string that can be present.

3. Min:

It represents the minimum length of the string that can be present.

SET !LOOP 1
'URL GOTO=https://EXFESDGT.org/edit
SET !VAR1 EVAL("var characters = '#'; var max = 20; var min = 32;function randomString(length, chars) {    var mask = '';    if (chars.indexOf('a') > -1) mask += 'abcdefghijklmnopqrstuvwxyz';    if (chars.indexOf('A') > -1) mask += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';    if (chars.indexOf('#') > -1) mask += '0123456789';    var result = '';    for (var i = length; i > 0; --i) result += mask[Math.floor(Math.random() * mask.length)];    return result;};var randomString=randomString(Math.random() * (max - min) + min, characters); randomString;")
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:editForm ATTR=ID:customURL CONTENT={{!var1}}
TAG POS=1 TYPE=BUTTON FORM=ID:editForm ATTR=TXT:Save<SP>Changes

Old Answer: You can use this simple macro to insert a random string into the field and click 'Save Changes' every time. If you need to refresh the page, add the commented line also. Dont forget to loop this macro any number of times as per need.

SET !LOOP 1
'URL GOTO=https://EXFESDGT.org/edit
SET !VAR1 EVAL("var randomString=Math.random().toString(36).substr(7); randomString;")
PROMPT {{!var1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:editForm ATTR=ID:customURL CONTENT={{!var1}}
TAG POS=1 TYPE=BUTTON FORM=ID:editForm ATTR=TXT:Save<SP>Changes
Naren Murali
  • 19,250
  • 3
  • 27
  • 54
  • ok that helps a bit but the problem persist any ways i found that i need to add 1 more line for url in the end so that it does not redirect to new short hand of url i.e URL GOTO=https://EXFESDGT.org/edit but how ever i removed that PROMPT {{!VAR1}} line correct me if i went wrong cuz i dont want any prompts (no point of fully auto action if u have to click yes).Last thing i want it to add random alphanumeric 20-32 char string not 5 digits – Taranjeet Singh Aug 14 '17 at 11:44
  • i figured out all i needed was to add WAIT 1 in the end because marcro was looping too fast that it didn't gain focus on the CONTENT now all i need is to put random 32 digit Integer or 32 char string containing only number no alphabets – Taranjeet Singh Aug 14 '17 at 12:57