|
Post by joernhh on Mar 3, 2019 18:17:36 GMT
Hello, I would like to create a macro - but I cannot find how to make it: there is a text file "test1.txt" with abbreviations: abc12 bcd23 cde34 def45 ... I need a 3 x loop with the first three lines: 1 | FOR | I | = | 1 TO 3 | NEXT goto 1st line and read "abc12" into the clipboard ? | FOR | EACH | LINE IN | c:\test1.txt | DO ? | RUN ACTION | OUTPUT TO FILE | c:\test1.txt::OVERWRITE::%STRING1%
3 | RUN ACTION | COPY TO CLIPBOARD | %STRING1% 4 | RUN ACTION | | | | SELECT WINDOW BY NAME | test2.txt - Notepad write "1stLoop:abc12" 5 | X | X | | Keypress 1stLoop:%STRING1% 6 | FOR | NEXT This is a mix of maybe possible commands but I dont know what is corrcet / how it works. At the end I need 3 times a code like: "1stLoop:abc12" "2ndLoop:bcd23" "3rdLoop:cde34" Next day the 1st code is not valid, I delete it from the test1.txt and then I need: "1stLoop:bcd23" "2ndLoop:cde34" "3rdLoop:def45" Thank you for some help. Joern.
|
|
|
Post by Steve on Mar 4, 2019 6:04:07 GMT
Hi, I think i have something to get you started: 1 | FOR | I | = | 0 TO 3 | NEXT 2 | FOR | EACH | LINE IN | D:\Macro\INPUT\test.txt | DO 3 | RUN ACTION | COPY TO CLIPBOARD | %line% 4 | RUN ACTION | MESSAGE PROMPT | Line value is: %line% - The clipboard value: %clipboard%::line number %i%::1 5 | IF | WINDOW TITLE | test2.txt - Notepad | EXIST | SELECT WINDOW BY NAME | test2.txt - Notepad | ELSE | 8 | RUN ACTION | EXIT FOR 6 | IF | INTEGER VARIABLE | %I% | = | 1 | DEFINE STRING VARIABLE | %STRING%::1stLoop:%line% 7 | IF | INTEGER VARIABLE | %I% | = | 2 | DEFINE STRING VARIABLE | %STRING%::2ndLoop:%line% 8 | IF | INTEGER VARIABLE | %I% | = | 3 | DEFINE STRING VARIABLE | %STRING%::3rdLoop:%line% 9 | X | X | 250 | Keypress %STRING% 10 | X | X | 250 | Keypress ENTER 11 | IF | INTEGER VARIABLE | %I% | = | 3 | EXIT FOR 12 | FOR | NEXT 13 | FOR | NEXT For your FOR LOOPING checkout the Condition page here www.turnssoft.com/conditions.html#forI'm not sure why you want to copy the value to the clipboard, but this can be done with line 3.
|
|