play(loop) only plays first var #

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

play(loop) only plays first var #

by gschmack on Wed Feb 08, 2017 3:29 pm

imacros firefox 8.9.7
51.0.1 (32-bit)
Windows 10

script wont move to next var value and shows no errors ;/
Code: Select all
VERSION BUILD=8970419 RECORDER=FX
TAB T=1
SET !VAR1 1808
SET !LOOP {{!VAR1}}
SET !ERRORIGNORE YES

URL GOTO=http://focus.ghqnet.com/
FRAME NAME="links"
TAG POS=1 TYPE=A ATTR=TXT:Profile
FRAME NAME="main"
TAG POS=1 TYPE=A ATTR=TXT:Change<SP>Country<SP>Information<SP>and<SP>API<SP>Code
FRAME NAME="main"
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:Country ATTR=NAME:CountryNumber CONTENT={{!LOOP}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:Country ATTR=NAME:Submit
TAG POS=1 TYPE=INPUT:RADIO FORM=NAME:form1 ATTR=NAME:CountryID
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:form1 ATTR=NAME:Submit
ADD !VAR1 1
Last edited by gschmack on Wed Feb 08, 2017 4:28 pm, edited 1 time in total.
* imacros firefox 8.9.7
* Firefox 51.0.1 (32-bit)
* Windows 10
gschmack
 
Posts: 16
Joined: Sat Dec 10, 2016 8:00 pm

Re: play(loop) only plays first var #

by chivracq on Wed Feb 08, 2017 4:20 pm

gschmack wrote:script wont move to next var value and shows no errors ;/
Code: Select all
VERSION BUILD=8970419 RECORDER=FX
TAB T=1
SET !VAR1 1808
SET !LOOP {{!VAR1}}
SET !ERRORIGNORE YES

URL GOTO=http://focus.ghqnet.com/
FRAME NAME="links"
TAG POS=1 TYPE=A ATTR=TXT:Profile
FRAME NAME="main"
TAG POS=1 TYPE=A ATTR=TXT:Change<SP>Country<SP>Information<SP>and<SP>API<SP>Code
FRAME NAME="main"
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:Country ATTR=NAME:CountryNumber CONTENT={{!LOOP}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:Country ATTR=NAME:Submit
TAG POS=1 TYPE=INPUT:RADIO FORM=NAME:form1 ATTR=NAME:CountryID
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:form1 ATTR=NAME:Submit
ADD !VAR1 1

imacros firefox 8.9.7

Yeah, but sorry, I refuse to do any Digging in a Thread if FCI is not mentioned, like I tried to explain to you in your previous Thread when I finally intervened in it after 8 days while your Pb could have been solved in a few hours with only 1 Reply... :idea:

Thread Title in this current Thread is now correct (= Descriptive) and you do mention your iMacros Version, perfect, that's already a huge improvement on your previous Thread, ah-ah...!, but I miss the "rest" for "FCI" (the "F" in "FCI" stands for "FULL"... :idea: ):
=> FCIM...! :mrgreen: (Read my Sig...)
(And you add your FCI to your OP (at the complete Top is the best place, this is usually the most important Tech Info for all Threads) + post a Reply after me to bump your Thread otherwise I may not notice your Edit...)

And from only your Thread Title and 1 glimpse at the first Lines of your Script (which you perfectly posted btw, very good...), I think I already know the Answer/Solution to your Pb..., ah-ah...!
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: play(loop) only plays first var #

by gschmack on Wed Feb 08, 2017 4:32 pm

lol thanks, i'm still new here :P

using this version of imacros cause of the help from the other thread, I use another script the same way and it works fine so that's why i'm asking for help again!

here's my other one that I based it off :

Code: Select all
SET !DATASOURCE_DELIMITER *
SET !VAR1 1272
SET !ERRORIGNORE YES
SET !VAR2 1
SET !LOOP {{!VAR2}}


URL GOTO=http://earthgraphs.com/?p=country&num={{!LOOP}}&reset={{!VAR1}}&last_h=72&tab=history
TAG POS=1 TYPE=TABLE ATTR=TXT:Time<SP>Rank<SP>Name<SP>(#)<SP>Land<SP>Networth<SP>Special* EXTRACT=TXT
SAVEAS TYPE=TXT FOLDER=c:\eedata\ FILE=ffa.csv
SET !DATASOURCE C:\ffa.csv
ADD !VAR1 10


the set delimiter part doesnt work on that one though, i presume I should start a new post for that haha :)
* imacros firefox 8.9.7
* Firefox 51.0.1 (32-bit)
* Windows 10
gschmack
 
Posts: 16
Joined: Sat Dec 10, 2016 8:00 pm

Re: play(loop) only plays first var #

by chivracq on Wed Feb 08, 2017 6:17 pm

gschmack wrote:lol thanks, i'm still new here :P

using this version of imacros cause of the help from the other thread, I use another script the same way and it works fine so that's why i'm asking for help again!

here's my other one that I based it off :
Code: Select all
SET !DATASOURCE_DELIMITER *
SET !VAR1 1272
SET !ERRORIGNORE YES
SET !VAR2 1
SET !LOOP {{!VAR2}}

URL GOTO=http://earthgraphs.com/?p=country&num={{!LOOP}}&reset={{!VAR1}}&last_h=72&tab=history
TAG POS=1 TYPE=TABLE ATTR=TXT:Time<SP>Rank<SP>Name<SP>(#)<SP>Land<SP>Networth<SP>Special* EXTRACT=TXT
SAVEAS TYPE=TXT FOLDER=c:\eedata\ FILE=ffa.csv
SET !DATASOURCE C:\ffa.csv
ADD !VAR1 10


the set delimiter part doesnt work on that one though, i presume I should start a new post for that haha :)

Code: Select all
imacros firefox 8.9.7
51.0.1 (32-bit)
Windows 10

Well-well-well, we do have your FCI now, perfect...!! :D
(Well, I'm joking now, but I won't react to your Thread next time if you don't mention it directly, I never ask more than twice... :idea: )

OK, concerning your first Qt (about "play(loop) only plays first var #" and "script wont move to next var value and shows no errors ;/"), the Reason is simple (if I'm correct of course, but I use a similar Mechanism in several of my Scripts and I make from time to time the same "Mistake" as well, and it still happens to me regularly, grrr...!), it comes from your:
Code: Select all
SET !VAR1 1808
SET !LOOP {{!VAR1}}
... which btw is exactly the same as:
Code: Select all
SET !LOOP 1808
..., your:
Code: Select all
ADD !VAR1 1
... at the end of your Script doesn't do anything, all Vars are reset after each Loop, except the '!LOOP' Var which gets incremented with "1" for each Loop, but the "SET !LOOP n" Statement only gets read by iMacros on the first Loop (to know from which Number to start) and is ignored on all following Loops.

And I guess that if you want to loop your Macro 20 times, that you probably specify "20" in the 'Max' Field for 'Play (Loop)'...
Well, WRONG...!
Because on the first Loop, iMacros starts and thinks:
"OK, first Loop, '!LOOP'=1, let's run this Script..., oh.......!! here is a Statement telling me that '!LOOP'=1808, OK, I'll remember that..., let's finish running this Macro for the first Loop..., hen-hen!, first Loop finished, '!LOOP'=1808, I will continue for '!LOOP'=1809 until 'Max_Loop', OK, next Loop, let's check 'Max_Loop' btw..., oh...! 'Max_Loop'=20, uh...!, 20<1808, that means I'm finished, OK, ABORT, I've done my Job, Customer Happy...!"

=> Meaning that you must specify "1827" in 'Max_Loop' if you want to loop your Macro exactly 20 times...! (Otherwise, it will only run once...)

>>>

Concerning your second Qt about:
Code: Select all
SET !DATASOURCE_DELIMITER *
..., but hum, your "the set delimiter part doesnt work on that one though" is a bit vague, what doesn't work...?, what happens..., or doesn't happen that you expect...?

But, hum, I already have an Idea, I think, because I got confused as well myself several times as I find the Name a bit wrongly chosen, it should be called "!DATASOURCE_SEPARATOR" (and not "_DELIMITER") as the "Standard"/Default Separator is a Comma in '.CSV' File, but you can change this Comma to the Character that you specify with '!DATASOURCE_DELIMITER'...
But I reckon you were expecting the Double Quotes surrounding all extracted/saved Data to be replaced by your *, but nope, this Setting plays (for FF, but I think it's only available for FF, IE can use the OS Regional Settings and I guess you cannot change anything on CR) on the Separator (both for '!DATASOURCE' and 'SAVEAS') and not on the Delimiter...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: play(loop) only plays first var #

by gschmack on Wed Feb 08, 2017 6:35 pm

first part worked like a charm ;)

so if i read your deliminator part right, your saying no way that you know of to remove the double "" 's?
* imacros firefox 8.9.7
* Firefox 51.0.1 (32-bit)
* Windows 10
gschmack
 
Posts: 16
Joined: Sat Dec 10, 2016 8:00 pm

Re: play(loop) only plays first var #

by chivracq on Wed Feb 08, 2017 7:08 pm

gschmack wrote:first part worked like a charm ;)

OK, good...! :D

Hum, sorry to come back on this, concerning mentioning your FCI in your OP when you open a new Thread (or post for the first time in some existing Thread), I notice that you've now included/added your FCI in/to your Sig..., good Intention..., but hum..., realize that you only have one Dynamic Sig for the whole Forum, so the FCI in your Sig only indicates your current FCI and you should still hard-code it in your OP when opening a Thread as it can otherwise be quite confusing for sbd reading a Thread of your a few weeks/months/years later and you'll then have updated your FCI (and your Sig) to some later Version(s)...

gschmack wrote:so if i read your deliminator part right, your saying no way that you know of to remove the double "" 's?

"... no way that you know of to remove the double "" 's?"
Euh..., no I didn't say that..., I only replied to your vague Statement that '!DATASOURCE_DELIMITER' was not working... I answered that it works and I explained how it works...
So I will stop trying to answer your Qt's proactively and will strictly answer your Qt's... The whole 'Process" will take longer and you better ask the correct Qt's, or I might bet bored a bit quickly, ah-ah...! So OK, here we go...:

"... your saying no way that you know of to remove the double "" 's?"
=> My Answer is: "No, I don't/didn't say that...!"
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: play(loop) only plays first var #

by gschmack on Thu Feb 09, 2017 2:28 pm

ok then my question would become how do I remove the double "" and or the , --- because some of the data extracted has thousands value so when importing into excel/open office tabing coloums by , doesn't keep the thousands value together.

So when i did set !datasource_delimiter * , I was expecting the , to be changed to *, but it was not ( that's what I meant by not working) ;)
* imacros firefox 8.9.7
* Firefox 51.0.1 (32-bit)
* Windows 10
gschmack
 
Posts: 16
Joined: Sat Dec 10, 2016 8:00 pm

Re: play(loop) only plays first var #

by chivracq on Thu Feb 09, 2017 5:52 pm

gschmack wrote:ok then my question would become how do I remove the double "" and or the , --- because some of the data extracted has thousands value so when importing into excel/open office tabing coloums by , doesn't keep the thousands value together.

So when i did set !datasource_delimiter * , I was expecting the , to be changed to *, but it was not ( that's what I meant by not working) ;)

Hum, removing the _"_ as Data Delimiter from iMacros for FF is not possible I think, without hacking/decompiling the Add-on and modifying it yourself, which is quite High-Level Advanced Use (and I think I only know of 2 other Advanced Users doing that as well...) as the Process of adding the _"_ is done by the 'SAVEAS' Command and you cannot manipulate the Data from '!EXTRACT' anymore.
You could do a 'Find & Replace' in your '.CSV' File from Notepad maybe... Or use iMacros for IE which doesn't add those _"_..., only iMacros for FF does it... (Hum, not sure about CR...) Several Threads on the Forum complaining about this "forced" Behaviour on FF with no way to control it...

But if all Data in the 'CSV' is enclosed with _"_, and you specify _"_ as Data Delimiter in Excel when you import the Data, Excel should treat all Strings between 2 _"_ as one Cell, and therefore keep your "thousands value together"... It's been years since I haven't used Excel anymore, I use OpenOffice since, and I think it works fine with OO..., as long as you manually select the "correct" Options (and the Default pre-selected Settings are not always the correct ones...!, at least in OO...) in the 'Import CSV' Screen when opening a '.CSV' in Excel/OO, well, I guess it must the same in Excel...

And last time I tested (hum, several months ago, I guess), '!DATASOURCE_DELIMITER' was working fine on FF to modify the Data Separator (_,_) or whatever if was supposed to modify/control...
Provide some mini-Script extracting a few Fields with "Thousands" with Commas from some ("Standard") public Site and I can give it a Try (again), TechSup will need/ask you that anyway if there is some Bug... But do it a bit correctly and with all "careful attention", and mention as well your OS Language + OS Regional Settings for 'Decimal Separator' and 'Thousands Separator', same Thing for Excel if those Settings are "separate" as this might play a Role...
+ Mention clearly what you get for Data/Result and what you expect exactly as if it "works" for me but I don't know exactly what you expect, I won't be spending any time trying to guess what you were expecting and what maybe went wrong...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: play(loop) only plays first var #

by gschmack on Sat Feb 11, 2017 8:35 am

yeah oo wasn't very helpful, i tried using " as the text delimiter and then I had extra commas lol, did by commas and i had extra quotes cells shifting because of numbers in the thousands. For what ever reason it was extracting a table with the word TIME, like this """TIME"", so the # of quotes was never the same.

my end solution was open as text file, search and replace ", as that would be the marker between each cell, replace it with { leaving { as the true delimiter and OO sorter it from there perfectly :-) just thought there should of been a way to specify it in the code.
* imacros firefox 8.9.7
* Firefox 51.0.1 (32-bit)
* Windows 10
gschmack
 
Posts: 16
Joined: Sat Dec 10, 2016 8:00 pm


Return to General Support & Discussions

Who is online

Users browsing this forum: No registered users and 4 guests

-->