Furgesson wrote: ↑Wed Aug 04, 2021 4:46 pm
Hello,
so right now my code works fine, but I need to put a variable inside now. Wherever I have WA1_22 I want to use a variable instead. The variable should increment with each loop. (Content for next loop should be WA1_23).
Im trying different things but cant get it to work. Even if I just use SET !VAR1 WA1_22 and replace all the "WA1_22" in my code with !VAR1 it gives me an error. What am I doing wrong?
I only have the free version
Code: Select all
VERSION BUILD=1011 RECORDER=CR
URL GOTO=https://xyz
WAIT SECONDS=10
TAG POS=1 TYPE=* ATTR=TXT:"WA1_22"
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=CLASS:icon-user
FRAME F=5
WAIT SECONDS=5
TAG POS=1 TYPE=INPUT:SEARCH FORM=ACTION:https://xyz& ATTR=ID:user-search-input CONTENT=wa1_22
Hum, maybe an "Idea" to read the Forum Rules when you join a Tech Forum...
=> Thread Title not compliant with the Form Rules, "HELP" has no Use in a Thread Title on a Tech Forum... (I'll edit your OP/Thread Title myself...)
=> Wrong Sub-Forum, Thread has nothing specific to the 'iMacros for CR' Sub-Forum. (I'll move your Thread to the 'General' one...)
=> FCIM...!
(Read my Sig also...)
>>>
=> FCI...?:
iMacros for CR v10.1.1, 'Free', CR92...?, OS...?
>>>
"... it gives me an error. What am I doing wrong?"
=> Well, I don't know..., "it gives me an error" is vague if you don't post the Error, and you don't post either how you tried to (re)use the '!VAR1' Var...?
(Your "SET !VAR1 WA1_22" is correct btw...)
=> "Correct" way to use/reuse a Var would be:
Code: Select all
SET !VAR1 WA1_22
TAG POS=1 TYPE=* ATTR=TXT:{{!VAR1}}
... Or maybe if the "WA1_" Part is going to remain Constant while the "22" Part is going to be Incremented, you could also use:
Code: Select all
SET !VAR1 22
TAG POS=1 TYPE=* ATTR=TXT:WA1_{{!VAR1}}
... And you can then use the 'ADD' Command to increment '!VAR1' using '{{!LOOP}}'...
- (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...