How to loop with imacros javascript code datasource row with

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Profinkonsults
Posts: 3
Joined: Mon Nov 02, 2015 6:46 am
Location: Vilnius, Lithuania
Contact:

How to loop with imacros javascript code datasource row with

Post by Profinkonsults » Tue Aug 28, 2018 10:48 am

I made code to loop website page, pos variable edit to enter post on page and replace price field from datasource file column row in loop sequence. I can go to pages, enter posts via pos edits using loop but the code does not complete price change. How to amend code to complete the third tasks with the loop?

Code: Select all

iimPlay('MDBALDAI_LOGIN.iim');
for (j = 1; j < 9; j++) {
    iimSet("loop", j);   
    iimPlay("CODE:URL GOTO=https://www.skelbiu.lt/mano-skelbimai/index.php?mod=myData&action=myAds&tab=1&p={{loop}}");
    iimPlay("CODE: WAIT SECONDS=3");
    for (k = 1; k < 15; k++) {
        iimSet("kloop", k);   
        iimPlay("CODE: TAG POS={{kloop}} TYPE=A ATTR=TXT:Redaguoti"); 
        iimPlay("CODE: WAIT SECONDS=3");
        iimPlay("CODE: SET !DATASOURCE C:\Users\User\Desktop\KAINOS.csv")
        iimPlay("CODE:  SET !DATASOURCE_COLUMNS 1")
        iimPlay("CODE:  SET !DATASOURCE_LINE {{kloop}}")
        iimPlay("CODE:  SET !EXTRACT_TEST_POPUP NO")
        iimPlay("CODE:  TAG POS=1 TYPE=INPUT:TEXT FORM=ID:insertData ATTR=ID:adsPrice CONTENT={{!COL1}}")
        iimPlay("CODE:  WAIT SECONDS=4")
        iimPlay("CODE:  BACK")
        }
    } 
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to loop with imacros javascript code datasource row

Post by chivracq » Tue Aug 28, 2018 1:27 pm

Profinkonsults wrote:I made code to loop website page, pos variable edit to enter post on page and replace price field from datasource file column row in loop sequence. I can go to pages, enter posts via pos edits using loop but the code does not complete price change. How to amend code to complete the third tasks with the loop?

Code: Select all

iimPlay('MDBALDAI_LOGIN.iim');
for (j = 1; j < 9; j++) {
    iimSet("loop", j);   
    iimPlay("CODE:URL GOTO=https://www.skelbiu.lt/mano-skelbimai/index.php?mod=myData&action=myAds&tab=1&p={{loop}}");
    iimPlay("CODE: WAIT SECONDS=3");
    for (k = 1; k < 15; k++) {
        iimSet("kloop", k);   
        iimPlay("CODE: TAG POS={{kloop}} TYPE=A ATTR=TXT:Redaguoti"); 
        iimPlay("CODE: WAIT SECONDS=3");
        iimPlay("CODE: SET !DATASOURCE C:\Users\User\Desktop\KAINOS.csv")
        iimPlay("CODE:  SET !DATASOURCE_COLUMNS 1")
        iimPlay("CODE:  SET !DATASOURCE_LINE {{kloop}}")
        iimPlay("CODE:  SET !EXTRACT_TEST_POPUP NO")
        iimPlay("CODE:  TAG POS=1 TYPE=INPUT:TEXT FORM=ID:insertData ATTR=ID:adsPrice CONTENT={{!COL1}}")
        iimPlay("CODE:  WAIT SECONDS=4")
        iimPlay("CODE:  BACK")
        }
    } 
Yep, normal..., you are making one "fundamental" Mistake in your Script... :|

But useless I reckon to try to help you again as you never bothered to follow up on your previous Thread from 6 weeks ago... (nor on your parallel Thread on SOF)...! :roll:

>>>

+ Parallel Thread on SOF:
- How to loop with imacros javascript code datasource row with page and page POS for edit variables?
(No Replies yet...)
- (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...
Profinkonsults
Posts: 3
Joined: Mon Nov 02, 2015 6:46 am
Location: Vilnius, Lithuania
Contact:

Re: How to loop with imacros javascript code datasource row

Post by Profinkonsults » Tue Aug 28, 2018 7:09 pm

I think my 'fundamental' problem was iimSet("kloop", k) placement, since it has to be below function below replacement line with "insertData". But after site changes page sequence of datasaource file starts over again. Is there method how to continue datasource file row?
For the previous code, while programming for longer, eyes become tired, thus there were simple syntax errors, which I solved soon.
Continuation of datasource rows while looping is important issue. I would great full for your reply.
Is there method in imacros javascript restart loop with datasource file row next in sequence value?
:D
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to loop with imacros javascript code datasource row

Post by chivracq » Tue Aug 28, 2018 8:12 pm

Profinkonsults wrote:I think my 'fundamental' problem was iimSet("kloop", k) placement, since it has to be below function below replacement line with "insertData".
Nope...
Profinkonsults wrote:But after site changes page sequence of datasaource file starts over again. Is there method how to continue datasource file row?
Yep...
Profinkonsults wrote:For the previous code, while programming for longer, eyes become tired, thus there were simple syntax errors, which I solved soon.
Continuation of datasource rows while looping is important issue. I would great full for your reply.
Is there method in imacros javascript restart loop with datasource file row next in sequence value?
:D
Yeah, well, you'll first need to follow up on your previous Thread and to finish it "neatly" and useful for other Users, by answering my Qt's and reacting to my Remarks/Suggs, and sharing your Sol once you managed to solve your Pb... :idea:
(+ Same thing on SOF as well for that Thread of course, on that Forum some User gave you a Solution but you didn't bother to react/accept their Solution or share your Sol either if you managed to solve your Pb by yourself or maybe from my Reply on this Forum...)

+ Need to mention your FCI for this Thread as well of course, I only ask once, you completely missed/ignored that part in your previous Thread..., and you can maybe bump this Thread in 6 weeks if you are still looking for a Sol, tja...! :roll:
Hum..., being a bit nice..., make it "4 weeks" if you handle your previous Thread on both Forums "very correctly" then... 8)
(But I'm already nearly "impressed" by the Follow-up on this one, hum..., half impressed... :wink: )
- (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...
Post Reply