"it seems that I have to change the whole coding to do that..."green.pine wrote:thank you for your reply, and explanation;
I did a new try, but still can not do the anther loop, it seems that I have to change the whole coding to do that, I get confused, anyhow
this time I use it another way, which does not work properly;
this time it gets keyword from csv file, do the search and grab the text, and go to TAB2, do the task there,come back to TAB1, click the Next, but get new keyword from CSV file and do a search, it suppose to do the highlighting and copy the text.Code: Select all
TAG POS=1 TYPE=A ATTR=ID:PNNEXT EXTRACT=TXT TAG POS=1 TYPE=A ATTR=ID:PNNEXT SET New_KW_Start EVAL("var s='{{!EXTRACT}}'; var x,y,z; if(s!=='next'){z=1;} else{z=0;}; z;") TAG POS={{New_KW_Start}} TYPE=INPUT:TEXT FORM=ID:tsf ATTR=ID:lst-ib CONTENT={{!COL1}} TAG POS={{New_KW_Start}} TYPE=INPUT:SUBMIT FORM=ID:tsf ATTR=NAME:btnK SET !TIMEOUT_STEP 1
It does not even go through all keywords in the csv file, only 5 keywords and stops, no errors,
somehow I have to change the value of Loop_Switch again, or redo the whole coding, which is too complicated for me.
appreciate your help again.Code: Select all
SET URL_GOTO EVAL("var n='{{!LOOP}}', u='{{URL_Search}}'; var x,y,z; if(n==1){z=u;} else{z='';}; z;") URL GOTO={{URL_GOTO}} TAG POS={{LOOP_Switch}} TYPE=INPUT:TEXT FORM=ID:tsf ATTR=ID:lst-ib CONTENT={{!COL1}} TAG POS={{LOOP_Switch}} TYPE=INPUT:SUBMIT FORM=ID:tsf ATTR=NAME:btnK SET !TIMEOUT_STEP 1
thanks
=> Well, yep a bit, ah-ah..! In JavaScript and any "proper" Programming Language you can usually reuse some existing Code and encapsulate it into some Object/Function/even Macro for iMacros to reuse it in some broader Context, but in pure '.iim' with 'EVAL()', you need to "plan" your "Strategy" thoroughly and carefully...
The original Topic of the Thread with the Info you had provided was "only" about stopping the Script if some Button/Link was not present anymore, the 2nd Level of Looping and Input from a DataSource came afterwards, it's "easier" for a "Global Strategy" if you provide all Info to get a "Global Overview" of your Scenario from the beginning...
But..., Okay, I mentioned "Nested Loops" already, but your Script still doesn't contain any "Nested Loop(s)" Ingredient in what you try...
A "simple" Search on "Nested Loops Modulo" returns quite a few related/similar Threads and the 1st one from the List is already completely similar to your Scenario I would think from a quick Reading...:
- How to use Conditional EVAL going to certain urls
=> Have a look at this Thread already and to understand the Principle and see if you can adapt/apply it to your Needs... The other User managed to write and get his whole Script working, then you can do it as well, ah-ah...!