Shoez wrote: ↑Sat Nov 20, 2021 10:41 pm
I don't know if I've done this right, can you double check if I've done what you said to do? I don't know where exactly to put things, I don't have great understanding skills.
Code: Select all
var Comment = "";
Comment += "CODE:" + "\n";
Comment += "SET !ERRORIGNORE YES" + "\n";
Comment += "SET !TIMEOUT_PAGE 5" + "\n";
Comment += "SET !TIMEOUT_STEP 0" + "\n";
Comment += "SET !DATASOURCE text<sp>file.txt" + "\n";
Comment += "SET !DATASOURCE_LINE 'n Modulo[3]' n%3" + "\n";
Comment += "WAIT SECONDS=1" + "\n";
Comment += "EVENT TYPE=CLICK SELECTOR=\"#contenteditable-root\" BUTTON=0" + "\n";
Comment += "EVENTS TYPE=KEYPRESS SELECTOR=\"#contenteditable-root\" CHARS={{!col1}}" + "\n";
Comment += "WAIT SECONDS=2" + "\n";
Comment += "TAG POS=3 TYPE=TP-YT-PAPER-BUTTON ATTR=ID:button" + "\n";
Comment += "WAIT SECONDS=3" + "\n";
Hum, again, "take it easy" with unnecessary extra Levels of Quoting, you can quote me if you want, but you don't need to quote yourself (your previous Post) again, this last Reply of yours has nothing related to your FCI anymore... But OK, don't "worry", I will clean up the Thread "at the end", if "too much Quoting" hinders Readability...
>>>
Ah-ah...!, nope, not good...!
This Line:
Code: Select all
Comment += "SET !DATASOURCE_LINE 'n Modulo[3]' n%3" + "\n";
Well, "n Modulo[3]" that I used in my previous Reply is simply how I call the Technique that you need (or can use) (... and
apparently I'm not the only one, ah-ah...!
), and "n%3" is how to implement it in pure JS, either in `EVAL()` if you were using an '.iim' Script, or in "pure" JS in your '.js' Script.
To understand the Mechanism, try looping the following mini-Script, say, 10 times for example:
Code: Select all
SET Modulo_3 EVAL("var n='{{!LOOP}}'; var z=n%3; z;")
PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Modulo_3:<SP>_{{Modulo_3}}_
And that Method would work if using an '.iim' Script (in pure '.iim'), I never use '.js' Scripts myself, so I always implement Solutions that would work in pure '.iim'. If it works in "pure" '.iim', then you can (nearly) always convert it to a '.js' Implementation, => in this Case with a "main" '[1-n]' `for` Loop in JS like you are "probably" already doing... (I don't know, you didn't post that part...
)
>>>
Another Solution/Implementation you could also use, but only with a '.js' Script, would be to use a "main" '[1-n]' `for` Loop, and a nested '[1-3]' `for` Loop inside the main Loop. That's another Possibility, if you "don't like" the 'Modulo' Operator...
>>>
And hum, I "finally" understood why I keep/kept getting "a bit confused" about your Scenario, and mentioning "Cols" instead of "Lines", that's because your Thread/Qt on SOF is actually about Cols, and is not "exactly" the same like this current Thread on our Forum...:
... to copy text top to bottom to another notepad file...
+
I want the macro to send text from each column in a vertical pattern. E.g: column one will be sent first, then next run it will move onto the 2nd column and repeat for all columns.
... And in this current Thread (on our Forum), you already have the "vertical" DataSource File with the 3 Rows/Lines. And what you want in your Thread on SOF is a bit different, the easiest way to do what you want, is simply to open your ("horizontal") '.txt' File in 'Excel', select the 3 Cells, => Copy => "Paste Special" + "Transpose", and re-save your File...
Can also be done from iMacros, I have 2 Methods to do that if you still need that Func from an iMacros Script, one in pure '.iim', and one in pure '.js', ah-ah...!, but the '.iim' one can also be ported to '.js'...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...