How fill field of a form using file stored in DATASOURCES

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
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
giuseppe
Posts: 40
Joined: Sat Oct 15, 2016 3:30 pm

How fill field of a form using file stored in DATASOURCES

Post by giuseppe » Thu Jun 21, 2018 12:15 am

Hi,
I have the follow file listofphases.txt stored in DATASOURCES folder.
in this file there is a list of phases like the follow example:
I am interested
I accept condition
I want know more
and so on...
Id like fill a form using this list of phases.
So, I need to go into field 1 and paste LINE 1 (I am interested).
After that I need to go into field 2 and paste LINE 2 (I accept condition)
And so on...
So, id like know the code in order to do that.
Concretely, for the field 1I need to add after the code content= a special code that import line 1
For the field 2 I need to add after the code content= a special code that import line 2
and so on...
I know I also need to add the follow code: SET !DATASOURCE listofphases.txt
and I should to add some code more...
But I do not know concretely what...?
can someone help me?
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 8195
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How fill field of a form using file stored in DATASOURCE

Post by chivracq » Thu Jun 21, 2018 2:00 am

giuseppe wrote:Hi,
I have the follow file listofphases.txt stored in DATASOURCES folder.
in this file there is a list of phases like the follow example:
I am interested
I accept condition
I want know more
and so on...
Id like fill a form using this list of phases.
So, I need to go into field 1 and paste LINE 1 (I am interested).
After that I need to go into field 2 and paste LINE 2 (I accept condition)
And so on...
So, id like know the code in order to do that.
Concretely, for the field 1I need to add after the code content= a special code that import line 1
For the field 2 I need to add after the code content= a special code that import line 2
and so on...
I know I also need to add the follow code:

Code: Select all

SET !DATASOURCE listofphases.txt
and I should to add some code more...
But I do not know concretely what...?
can someone help me?
CIM...! :mrgreen: ... => for me to read... :idea: , you did "better" in your previous Thread (to which I didn't react/answer because I don't help for Social Media... :oops: )...

"CIM" btw stands for "Config Info MISSING", but if you do mention your Config/Environment, then I use "FCI" (=> "Full Config Info")..., all Abbreviations I use are explained in my Sig anyway... (Just a Detail, don't worry, but if you don't understand what 2 Abbreviations mean exactly, and how to use them "correctly", I usually already "draw a line" to how you might be coding..., just saying... :wink: )

Hum, and I don't see any Script posted in this current Thread, if your Thread is not about Social Media (or any of the few other "Areas" I "ethically" refuse to help for), only expect "Generic" Advice from me... :wink:
- (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: 8195
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How fill field of a form using file stored in DATASOURCE

Post by chivracq » Sun Jun 24, 2018 4:24 pm

And...?, any Follow-up as I see you are Online checking the Forum/your Thread...? :wink:
- (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...
giuseppe
Posts: 40
Joined: Sat Oct 15, 2016 3:30 pm

Re: How fill field of a form using file stored in DATASOURCE

Post by giuseppe » Sun Jun 24, 2018 5:10 pm

Ok, I will provide a real example.
Resuming what I want to do is make a LOOP into another LOOP. I explain well.
I have a few google map: MAP 1, MAP 2, MAP 3 and MAP 4
Link of this MAP are listed in a file txt named LINKMAP.txt and saved in the folder name DATASOURCE.
Link of maps are the follow:
https://www.google.com/maps/d/u/1/edit? ... 00064&z=18
https://www.google.com/maps/d/u/1/edit? ... 00064&z=18
https://www.google.com/maps/d/u/1/edit? ... 00064&z=18
https://www.google.com/maps/d/u/1/edit? ... 00064&z=18

Into each map I need introduce a lot directions. I have list of this direction in a txt file. Also this txt file is stored into the folder DATASOURCE. File is name DIRECTIONS.txt

What I need to do is:
0. Make login into google mail with my mail
1. Go to the link showed in LINE 1 into the file LINKMAP.txt (it mean go to MAP1...)
2. Introduce all the directions listed in the file DIRECTIONS.txt
3. Go to the link showed in LINE 2 into the file LINKMAP.txt (it mean go to MAP2...)
4. Introduce all the directions listed in the file DIRECTIONS.txt
5. Go to the link showed in LINE3 into the file LINKMAP.txt (it mean go to MAP3...)
6. Introduce all the directions listed in the file DIRECTIONS.txt
7. Go to the link showed in LINE4 into the file LINKMAP.txt (it mean go to MAP4...)
8. Introduce all the directions listed in the file DIRECTIONS.txt

In order to do that I have the follow macro.
FIRST MACRO is for to make login into gmail
SECOND MACRO is for to go to MAP1, MAP2, MAP3 and MAP4

Code: Select all

FirstMacro = "CODE:";
FirstMacro += "TAB T=1" + "\n";
FirstMacro += "URL GOTO=https://accounts.google.com/signin/v2/sl/pwd?passive=1209600&continue=https%3A%2F%2Faccounts.google.com%2Fb%2F0%2FManageAccount&followup=https%3A%2F%2Faccounts.google.com%2Fb%2F0%2FManageAccount&authuser=0&flowName=GlifWebSignIn&flowEntry=ServiceLogin" + "\n";
FirstMacro += "SET !ENCRYPTION NO" + "\n";
FirstMacro += "TAG POS=1 TYPE=PATH ATTR=D:M7.41<SP>7.84L12<SP>12.42l4.59-4.58L18<SP>9.25l-6<SP>6-6-6z&&TXT:" + "\n";
FirstMacro += "TAG POS=1 TYPE=P ATTR=TXT:Fes<SP>servir<SP>un<SP>altre<SP>compte" + "\n";
FirstMacro += "TAG POS=1 TYPE=INPUT:EMAIL FORM=ACTION:https://accounts.google.com/ServiceLogin/identifier?passive=1209600&continue=https%3A%2F%2Faccounts.google.com%2Fb%2F0%2FManageAccount&followup=https%3A%2F%2Faccounts.google.com%2Fb%2F0%2FManageAccount&authuser=0&flowName=GlifWebSignIn&flowEntry=AddSession ATTR=ID:identifierId CONTENT=mymail@gmail.com" + "\n";
FirstMacro += "TAG POS=1 TYPE=SPAN ATTR=TXT:Següent" + "\n";
FirstMacro += "TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:/signin/v2/challenge/password/empty ATTR=NAME:password CONTENT=12345678" + "\n";
FirstMacro += "TAG POS=1 TYPE=SPAN ATTR=TXT:Següent" + "\n";

var SecondMacro = "";
SecondMacro = "CODE:";
SecondMacro += "TAB T=1" + "\n";
SecondMacro += "SET !ERRORIGNORE YES" + "\n";
SecondMacro += "SET !TIMEOUT_PAGE 10" + "\n";
SecondMacro += "SET !DATASOURCE LINKMAP.txt" + "\n";
SecondMacro += "SET !DATASOURCE_COLUMNS 1" + "\n";
SecondMacro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
SecondMacro += "URL GOTO={{!COL1}}" + "\n";

iimPlay(FirstMacro);

for(var i=1; i<5; i++)
{
iimSet("LOOPNUM", i)
iimPlay(SecondMacro);
}
With this previously macro, I only go to the 4 maps using the LOOP function. and I do not add directions...
What I need to do is:
Go to MAP 1 and to add directions listed in file DIRECTIONS.txt
Go to MAP 2 and to add directions listed in file DIRECTIONS.txt
Go to MAP 3 and to add directions listed in file DIRECTIONS.txt
Go to MAP 4 and to add directions listed in file DIRECTIONS.txt

Resultate will be make 4 maps similary, with the same directions. I can not explain why I need 4 MAP similary... It will be very complicated explain that...
But this is just what I look for...

In the follow example, for example, with the follow macro I have added "manually" the first direction showed into the file DIRECTIONS.txt.
First direction I have added is "avinguda<SP>tarradella,<SP>barcelona". It is showed after the word "CONTENT="

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://www.google.com/maps/d/u/1/edit?hl=es&mid=1cLh3kYwh-TgoZ0tBIk2wV3ZNPXmtIh7M&ll=41.979400487013166%2C2.821426400000064&z=18 ATTR=ID:mapsprosearch-field CONTENT=avinguda<SP>tarradella,<SP>barcelona
TAG POS=1 TYPE=IMG ATTR=SRC:https://ssl.gstatic.com/ui/v1/button/search-white.png
TAG POS=1 TYPE=DIV ATTR=ID:addtomap-button
But what I want to do is not to add "manually" each direction... but introduce them using the file DIRECTIONS.txt stored into the folder DATASOURCE.

I am not informatic, and I understand nothing... I do not know how to intoduce direction from file DIRECTIONS.txt using also LOOP function.
I do not know if I can introduce it into my SECOND MACRO, or if I need to add below my SECOND MACRO another macro (THERDMACRO).

In concusion what I look for is make ONE MACRO that use 2 files stored into DATASOURCE folder, and make a LOOP into another LOOP.

I hope you can help me.
Thanks in advanced for your support.

CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows 7
Last edited by giuseppe on Sun Jun 24, 2018 8:33 pm, edited 1 time in total.
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 8195
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How fill field of a form using file stored in DATASOURCE

Post by chivracq » Sun Jun 24, 2018 7:45 pm

giuseppe wrote:

Code: Select all

iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows 7
Ok, I will provide a real example.
Resuming what I want to do is make a LOOP into another LOOP. I explain well.
I have a few google map: MAP 1, MAP 2, MAP 3 and MAP 4
Link of this MAP are listed in a file txt named LINKMAP.txt and saved in the folder name DATASOURCE.
Link of maps are the follow:
https://www.google.com/maps/d/u/1/edit? ... 00064&z=18
https://www.google.com/maps/d/u/1/edit? ... 00064&z=18
https://www.google.com/maps/d/u/1/edit? ... 00064&z=18
https://www.google.com/maps/d/u/1/edit? ... 00064&z=18

Into each map I need introduce a lot directions. I have list of this direction in a txt file. Also this txt file is stored into the folder DATASOURCE. File is name DIRECTIONS.txt

What I need to do is:
0. Make login into google mail with my mail
1. Go to the link showed in LINE 1 into the file LINKMAP.txt (it mean go to MAP1...)
2. Introduce all the directions listed in the file DIRECTIONS.txt
3. Go to the link showed in LINE 2 into the file LINKMAP.txt (it mean go to MAP2...)
4. Introduce all the directions listed in the file DIRECTIONS.txt
5. Go to the link showed in LINE3 into the file LINKMAP.txt (it mean go to MAP3...)
6. Introduce all the directions listed in the file DIRECTIONS.txt
7. Go to the link showed in LINE4 into the file LINKMAP.txt (it mean go to MAP4...)
8. Introduce all the directions listed in the file DIRECTIONS.txt

In order to do that I have the follow macro.
FIRST MACRO is for to make login into gmail
SECOND MACRO is for to go to MAP1, MAP2, MAP3 and MAP4

Code: Select all

FirstMacro = "CODE:";
FirstMacro += "TAB T=1" + "\n";
FirstMacro += "URL GOTO=https://accounts.google.com/signin/v2/sl/pwd?passive=1209600&continue=https%3A%2F%2Faccounts.google.com%2Fb%2F0%2FManageAccount&followup=https%3A%2F%2Faccounts.google.com%2Fb%2F0%2FManageAccount&authuser=0&flowName=GlifWebSignIn&flowEntry=ServiceLogin" + "\n";
FirstMacro += "SET !ENCRYPTION NO" + "\n";
FirstMacro += "TAG POS=1 TYPE=PATH ATTR=D:M7.41<SP>7.84L12<SP>12.42l4.59-4.58L18<SP>9.25l-6<SP>6-6-6z&&TXT:" + "\n";
FirstMacro += "TAG POS=1 TYPE=P ATTR=TXT:Fes<SP>servir<SP>un<SP>altre<SP>compte" + "\n";
FirstMacro += "TAG POS=1 TYPE=INPUT:EMAIL FORM=ACTION:https://accounts.google.com/ServiceLogin/identifier?passive=1209600&continue=https%3A%2F%2Faccounts.google.com%2Fb%2F0%2FManageAccount&followup=https%3A%2F%2Faccounts.google.com%2Fb%2F0%2FManageAccount&authuser=0&flowName=GlifWebSignIn&flowEntry=AddSession ATTR=ID:identifierId CONTENT=mymail@gmail.com" + "\n";
FirstMacro += "TAG POS=1 TYPE=SPAN ATTR=TXT:Següent" + "\n";
FirstMacro += "TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:/signin/v2/challenge/password/empty ATTR=NAME:password CONTENT=[xxx]" + "\n";
FirstMacro += "TAG POS=1 TYPE=SPAN ATTR=TXT:Següent" + "\n";

var SecondMacro = "";
SecondMacro = "CODE:";
SecondMacro += "TAB T=1" + "\n";
SecondMacro += "SET !ERRORIGNORE YES" + "\n";
SecondMacro += "SET !TIMEOUT_PAGE 10" + "\n";
SecondMacro += "SET !DATASOURCE LINKMAP.txt" + "\n";
SecondMacro += "SET !DATASOURCE_COLUMNS 1" + "\n";
SecondMacro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
SecondMacro += "URL GOTO={{!COL1}}" + "\n";

iimPlay(FirstMacro);

for(var i=1; i<5; i++)
{
iimSet("LOOPNUM", i)
iimPlay(SecondMacro);
}
With this previously macro, I only go to the 4 maps using the LOOP function. and I do not add directions...
What I need to do is:
Go to MAP 1 and to add directions listed in file DIRECTIONS.txt
Go to MAP 2 and to add directions listed in file DIRECTIONS.txt
Go to MAP 3 and to add directions listed in file DIRECTIONS.txt
Go to MAP 4 and to add directions listed in file DIRECTIONS.txt

Resultate will be make 4 maps similary, with the same directions. I can not explain why I need 4 MAP similary... It will be very complicated explain that...
But this is just what I look for...

In the follow example, for example, with the follow macro I have added "manually" the first direction showed into the file DIRECTIONS.txt.
First direction I have added is "avinguda<SP>tarradella,<SP>barcelona". It is showed after the word "CONTENT="

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://www.google.com/maps/d/u/1/edit?hl=es&mid=1cLh3kYwh-TgoZ0tBIk2wV3ZNPXmtIh7M&ll=41.979400487013166%2C2.821426400000064&z=18 ATTR=ID:mapsprosearch-field CONTENT=avinguda<SP>tarradella,<SP>barcelona
TAG POS=1 TYPE=IMG ATTR=SRC:https://ssl.gstatic.com/ui/v1/button/search-white.png
TAG POS=1 TYPE=DIV ATTR=ID:addtomap-button
But what I want to do is not to add "manually" each direction... but introduce them using the file DIRECTIONS.txt stored into the folder DATASOURCE.

I am not informatic, and I understand nothing... I do not know how to intoduce direction from file DIRECTIONS.txt using also LOOP function.
I do not know if I can introduce it into my SECOND MACRO, or if I need to add below my SECOND MACRO another macro (THERDMACRO).

In concusion what I look for is make ONE MACRO that use 2 files stored into DATASOURCE folder, and make a LOOP into another LOOP.

I hope you can help me.
Thanks in advanced for your support.

CIM are:

Code: Select all

iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows 7
Hum..., interesting Scenario, ah-ah...! :D

Your 4 Maps are "Private" btw, I cannot access the 4 Links... But I understand the "Picture", no need to make them "Public" (if that's possible...?, I guess it probably is as GoogleDocs can be made Public...) or to find another way...
And you've left some Password in your 'FirstMacro', I've obfuscated it in my Quote...

But OK, you've already made some great Progress, very good...! I'm pretty impressed, to be honest...! 8)

OK, for the "missing part" about your Directions and how to implement that part..., hum-hum-gniarf-hum-gniarf-hum-hum... (sorry, that's me "thinking" a bit "loud" for a few seconds, oops...!), well..., it all depends a bit on your 'DIRECTIONS.txt' 2nd DataSource and its Content and how you've "organized" it in the File.

=> Not clear to me if you only have 1 Set of Directions that will be the same for all 4 Maps (or if each Map gets a different Set... and if the Nb of Directions will then be the same for all Maps and if that Nb can be variable, ah-ah...!)...!?
+ What will play a Role as well is if you've organized those Directions in the DataSource "Horizontally" (=> all in 1 same Row), or "Vertically" (=> all 1 one same Column).
=> Vertically I guess, as you mentioned "looping through the 2nd DataSource"... Then you will indeed need a 'ThirdMacro' with its own (Nested) Looping...

A bit depending on the if-if-if Parameters I mentioned (same Directions for all Maps // Fixed Nb), it might be interesting/possible to consider organizing the Data Horizontally in 'DIRECTIONS.txt', then you wouldn't need any Nested Looping as the same "LOOPNUM=i" would work for both DataSources... (and you wouldn't need a 'ThirdMacro' either, that Functionality could be added to your 'SecondMacro'.).

Another Option maybe, would be to use only one single DataSource, with the 4 Maps as "Header" (=> all 4 in the 1st Row (or 2nd Row) or in the 1st Colum, and the corresponding Directions Vertically in the same Col, or Horizontally in the same Row).

>>>

Hum..., and maybe you are actually trying to "reinvent the Wheel", ah-ah...!, I remember a very similar Case some other User had opened a few months ago, and I think they even had shared their Final Script..., let me see if I can locate it back... Yep, found it...!:
- IF THEN ELSE to input varying Data from .CSV list
Yep, very similar indeed, with as "Variation" on your own Scenario, that the User didn't know in advance which "Map" they were going to choose/need, so they had to add an extra Level of Conditional Logic, while you'll want to handle all 4 Maps. (And all done in pure '.iim'... 8) )

And if you need some Example(s) of Nested Loops, both in pure '.iim' or '.js' Script, here is a Thread I have in my Bookmarks (that links to other relevant Threads as well...):
- Nested Loops in 2 macros
Oh...!, and here is another one from my Bookmarks...:
- Nested Loops with Javascript

OK, good Reading/Thinking, good luck and post your Final Script... and/or if you get stuck... :wink:
- (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...
giuseppe
Posts: 40
Joined: Sat Oct 15, 2016 3:30 pm

Re: How fill field of a form using file stored in DATASOURCE

Post by giuseppe » Tue Jun 26, 2018 4:01 pm

Hi @chivracq,
first thanks to reply to my post and to have interest in it :)

I will reply to your question at the end of this post, but first I do my first question:

QUESTION 1: I have the follow macro:

Code: Select all

var SecondMacro = "";
SecondMacro = "CODE:";
SecondMacro += "TAB T=1" + "\n";
SecondMacro += "SET !ERRORIGNORE YES" + "\n";
SecondMacro += "SET !TIMEOUT_PAGE 10" + "\n";
SecondMacro += "SET !DATASOURCE LINKMAP.txt" + "\n";
SecondMacro += "SET !DATASOURCE_COLUMNS 1" + "\n";
SecondMacro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
SecondMacro += "URL GOTO={{!COL1}}" + "\n";

iimPlay(FirstMacro);

for(var i=1; i<5; i++)
{
iimSet("LOOPNUM", i)
iimPlay(SecondMacro);
}
and the lines of dates LINKS OF MAPS (into LINKMAP.txt) sometimes are 4, but some times are 2, and sometimes can be 8... So everytimes I need modifier macro and change value of i :
If I have 4 link, value must be for(var i=1; i<5; i++) so it is OK :) (I do not know way i<5 if LINKS are 4.... If I use i<4 the last link will not be reproduced from macro. But ok there are no ploblem... I will add 4+1 and problem is resolved :)
But if tomorrow link are 2, I need to change macro and write for(var i=1; i<3; i++)
And if the day next tomorrow link are 8, I need to change macro and write for(var i=1; i<9; i++)

So my QUESTION 1 is: there is a way to introduce a generic value to "i", for example "n"
for(var i=1; i<n; i++)
So with this solution will not be needed to change macro depending of the number of lines included in the txt file.
Maybe solution is just write "n" and macro will run like I want :), but I cannot do test because I am in holiday and I forget my computer with imacro... (I am stupid... very stupid....) so I can not test it...
So in conclusion I ask you if is possible introduce a "generic value" (maybe simply adding "n" :) and let the macro run depending the lines included in txt file.

Say that I will reply following to your questios:

Code: Select all

you've left some Password in your 'FirstMacro', I've obfuscated it in my Quote
Thanks, I am stupid... very stupid... very very vey stupid...
I edited my post...

Code: Select all

you've already made some great Progress, very good...! I'm pretty impressed, to be honest...!
I must to say that unfortunatelly I dont have progress... I do not understand macro codes... and I am not confortable with them... The macro I posted is a macro provided from support center one or 2 years ago... So it is not a macro of my creation. I have only changed the basic content of macro. But now I need do an important change in the macro and I will not be able to do it because I dont have knowledge in macro codecs. I'd like understand more about macro codecs, so I ask you if you can suggest me some special youtube link with basic instructions. I remember you I am not informatic and I understand nothing... So I need some tutorial very basic to start.

Code: Select all

=> Not clear to me if you only have 1 Set of Directions that will be the same for all 4 Maps (or if each Map gets a different Set... and if the Nb of Directions will then be the same for all Maps and if that Nb can be variable, ah-ah...!)...!?
I have thought to that and of course your question is a prioritary knowledge to write a correct macro that can do just what I need.
The problem is the follow: Some times I need a solution... and sometimes I need another solutions...
It is a bud news... but thinking in that my conclusion is make a macro very flexibly so I can use it in every case.
The macro very flexible is the follow:
Line 1 of DIRECTIONS.txt to Line 1 of LINKMAP.txt
Line 2 of DIRECTIONS.txt to Line 2 of LINKMAP.txt
Line 3 of DIRECTIONS.txt to Line 3 of LINKMAP.txt
Line 4 of DIRECTIONS.txt to Line 4 of LINKMAP.txt
Line 5 of DIRECTIONS.txt to Line 5 of LINKMAP.txt
and so on...

I do 2 example
EXAMPLE 1:
If for example I have 8 directions into the file DIRECTIONS.txt
Direction A (line 1)
Direction B (line 2)
...
DIRECTION H (line 8 )
And I have 1 maps (MAP 1). I only need copy 8 times the same link into file LINKMAP.txt
Link MAP 1 (line 1)
Link MAP 1 (line 2)
Link MAP 1 (line 3)
Link MAP 1 (line 4)
Link MAP 1 (line 5)
Link MAP 1 (line 6)
Link MAP 1 (line 7)
Link MAP 1 (line 8 )

Resultate should be:
Direction A to MAP 1
Direction B to MAP 1
Direction C to MAP 1
...
Direction H to MAP 1

Say in other words all the 8 directions go to MAP1

EXAMPLE 2:
If for example I have 8 directions into the file DIRECTIONS.txt
Direction A (line 1)
Direction B (line 2)
...
DIRECTION H (line 8 )
And I have 2 maps (MAP 1 and MAP 2). I only need copy 8 times the same link of MAP 1 and after 8 time the link of MAP 2 into file LINKMAP.txt
Link MAP 1 (line 1)
Link MAP 1 (line 2)
...
Link MAP 1 (line 8 )
Link MAP 2 (line 9)
Link MAP 2 (line 10)
...
Link MAP 2 (line 16)

Resultate should be:
Direction A to MAP 1
Direction B to MAP 1
Direction C to MAP 1
...
Direction H to MAP 1
Direction A to MAP 2
Direction B to MAP 2
Direction C to MAP 2
...
Direction H to MAP 2

Say in other words all the 8 direction go to MAP1 and also to MAP 2

With this solution I can also do solution like:
the first 4 direction to MAP 1, and the others to MAP 2. I only need to play copying LINK OF MAPS and DIRECTIONS one times, or two times or three times depending the resultate I want.
Off course I need to have the same number of line in the file DIRECTIONS.txt and in the file LINKMAP.txt.
Lines can be 8, or can be 50 or 100. I do not know...
With this solution macro will be very flexible and I can use it in every case.

Code: Select all

What will play a Role as well is if you've organized those Directions in the DataSource "Horizontally" (=> all in 1 same Row), or "Vertically" (=> all 1 one same Column).
Vertically. Only 1 column.

I have read your examples you provided me, but due my low knowledge I can not understand them...
I think solution I need:
Line 1 of DIRECTIONS.txt to Line 1 of LINKMAP.txt
Line 2 of DIRECTIONS.txt to Line 2 of LINKMAP.txt
Line 3 of DIRECTIONS.txt to Line 3 of LINKMAP.txt
Line 4 of DIRECTIONS.txt to Line 4 of LINKMAP.txt
Line 5 of DIRECTIONS.txt to Line 5 of LINKMAP.txt
and so on...
is very simple to write by who know macro lenguge. But for me is not possible make it...

Please, let me know if you can help me.
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 8195
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How fill field of a form using file stored in DATASOURCE

Post by chivracq » Wed Jun 27, 2018 2:57 am

I'll reply a bit/approx, in 2 blocks...
giuseppe wrote:Hi @chivracq,
first thanks to reply to my post and to have interest in it :)

I will reply to your question at the end of this post, but first I do my first question:

QUESTION 1: I have the follow macro:

Code: Select all

var SecondMacro = "";
SecondMacro = "CODE:";
SecondMacro += "TAB T=1" + "\n";
SecondMacro += "SET !ERRORIGNORE YES" + "\n";
SecondMacro += "SET !TIMEOUT_PAGE 10" + "\n";
SecondMacro += "SET !DATASOURCE LINKMAP.txt" + "\n";
SecondMacro += "SET !DATASOURCE_COLUMNS 1" + "\n";
SecondMacro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
SecondMacro += "URL GOTO={{!COL1}}" + "\n";

iimPlay(FirstMacro);

for(var i=1; i<5; i++)
{
iimSet("LOOPNUM", i)
iimPlay(SecondMacro);
}
and the lines of dates LINKS OF MAPS (into LINKMAP.txt) sometimes are 4, but some times are 2, and sometimes can be 8... So everytimes I need modifier macro and change value of i :
If I have 4 link, value must be for(var i=1; i<5; i++) so it is OK :) (I do not know way i<5 if LINKS are 4.... If I use i<4 the last link will not be reproduced from macro. But ok there are no ploblem... I will add 4+1 and problem is resolved :)
But if tomorrow link are 2, I need to change macro and write for(var i=1; i<3; i++)
And if the day next tomorrow link are 8, I need to change macro and write for(var i=1; i<9; i++)

So my QUESTION 1 is: there is a way to introduce a generic value to "i", for example "n"
for(var i=1; i<n; i++)
So with this solution will not be needed to change macro depending of the number of lines included in the txt file.
Maybe solution is just write "n" and macro will run like I want :), but I cannot do test because I am in holiday and I forget my computer with imacro... (I am stupid... very stupid....) so I can not test it...
So in conclusion I ask you if is possible introduce a "generic value" (maybe simply adding "n" :) and let the macro run depending the lines included in txt file.
Yep, possible of course, but you'll need to "define" your "generic value", everything that is "Dynamic" can be extracted/deducted/calculated/computed...
Here is some interesting Thread about computing the Tot_Nb_of_Rows in a '.CSV' DataSource, with different Solutions in pure '.iim' and '.js'...:
- Get number of lines from CSV and use as variable?
But all Solutions are more meant for some "standard"/"compact" DataSource, with all Cols at the same Level... Although "my" Sol can easily be adapted for Cols with different Lengths...
=> Easier in your Case might be to simply check for each Col (in each Loop) if the Cell in the same Col for the next Loop is not going to be empty by any chance and then stop the Looping (using some 'while'/'until' Loop then, instead of your 'for' Loop).

Forgot your Laptop while going on holidays, ah-ah...! Would never happen to me, ah-ah...! :shock:
Not too bad maybe, if you are soooo in love, ah-ah...! Enjoy...! :wink:
But, pfff, if you can use some PC/Laptop, it's not complicated to (re)install FF55/FF56 and iMacros for FF v9.0.3/v8.9.7, only takes a few Minutes, I've already done it maybe 20 times, visiting some Friend and thinking I would come back home earlier but nope, too nice, or falling in love on the spot, or I needed to show/demonstrate iMacros to some Friend(s), no big deal... (All my Macros on some USB-Stick + Laptop if left at home always remotely accessible through TeamViewer... (And if I had been even a bit more "clever", I would/should have installed once FF Portable on that USB-Stick (which I never did...!), with iMacros for FF of course, and together with the few other "unmissable" FF Add-ons I always use/need, then I even wouldn't have needed to (re)install FF and/or iMacros each time..., but tja, 20 times in 10 years, that's about once every 6 months, and in 50% of the times, was "only" meant for me to run a specific Macro, but in the other 50% times, meant as a "Demo" of iMacros for "Friends", so setting up iMacros on their PC/Laptop was still "useful"...))
giuseppe wrote:Say that I will reply following to your questios:

Code: Select all

you've left some Password in your 'FirstMacro', I've obfuscated it in my Quote
Thanks, I am stupid... very stupid... very very vey stupid...
I edited my post...

Code: Select all

you've already made some great Progress, very good...! I'm pretty impressed, to be honest...!
I must to say that unfortunatelly I dont have progress... I do not understand macro codes... and I am not confortable with them... The macro I posted is a macro provided from support center one or 2 years ago... So it is not a macro of my creation. I have only changed the basic content of macro. But now I need do an important change in the macro and I will not be able to do it because I dont have knowledge in macro codecs. I'd like understand more about macro codecs, so I ask you if you can suggest me some special youtube link with basic instructions. I remember you I am not informatic and I understand nothing... So I need some tutorial very basic to start.

Code: Select all

=> Not clear to me if you only have 1 Set of Directions that will be the same for all 4 Maps (or if each Map gets a different Set... and if the Nb of Directions will then be the same for all Maps and if that Nb can be variable, ah-ah...!)...!?
I have thought to that and of course your question is a prioritary knowledge to write a correct macro that can do just what I need.
The problem is the follow: Some times I need a solution... and sometimes I need another solutions...
It is a bud news... but thinking in that my conclusion is make a macro very flexibly so I can use it in every case.
The macro very flexible is the follow:

Code: Select all

Line 1 of DIRECTIONS.txt to Line 1 of LINKMAP.txt
Line 2 of DIRECTIONS.txt to Line 2 of LINKMAP.txt
Line 3 of DIRECTIONS.txt to Line 3 of LINKMAP.txt
Line 4 of DIRECTIONS.txt to Line 4 of LINKMAP.txt
Line 5 of DIRECTIONS.txt to Line 5 of LINKMAP.txt
and so on...

I do 2 example
EXAMPLE 1:
If for example I have 8 directions into the file DIRECTIONS.txt

Code: Select all

Direction A (line 1)
Direction B (line 2)
...
DIRECTION H (line 8 )
And I have 1 maps (MAP 1). I only need copy 8 times the same link into file LINKMAP.txt

Code: Select all

Link MAP 1 (line 1)
Link MAP 1 (line 2)
Link MAP 1 (line 3)
Link MAP 1 (line 4)
Link MAP 1 (line 5)
Link MAP 1 (line 6)
Link MAP 1 (line 7)
Link MAP 1 (line 8 )
Resultate should be:

Code: Select all

Direction A to MAP 1
Direction B to MAP 1
Direction C to MAP 1
...
Direction H to MAP 1
Say in other words all the 8 directions go to MAP1

EXAMPLE 2:
If for example I have 8 directions into the file DIRECTIONS.txt

Code: Select all

Direction A (line 1)
Direction B (line 2)
...
DIRECTION H (line 8 )
And I have 2 maps (MAP 1 and MAP 2). I only need copy 8 times the same link of MAP 1 and after 8 time the link of MAP 2 into file LINKMAP.txt

Code: Select all

Link MAP 1 (line 1)
Link MAP 1 (line 2)
...
Link MAP 1 (line 8 )
Link MAP 2 (line 9)
Link MAP 2 (line 10)
...
Link MAP 2 (line 16)
Resultate should be:

Code: Select all

Direction A to MAP 1
Direction B to MAP 1
Direction C to MAP 1
...
Direction H to MAP 1
Direction A to MAP 2
Direction B to MAP 2
Direction C to MAP 2
...
Direction H to MAP 2
Say in other words all the 8 direction go to MAP1 and also to MAP 2

With this solution I can also do solution like:
the first 4 direction to MAP 1, and the others to MAP 2. I only need to play copying LINK OF MAPS and DIRECTIONS one times, or two times or three times depending the resultate I want.
Off course I need to have the same number of line in the file DIRECTIONS.txt and in the file LINKMAP.txt.
Lines can be 8, or can be 50 or 100. I do not know...
With this solution macro will be very flexible and I can use it in every case.

Code: Select all

What will play a Role as well is if you've organized those Directions in the DataSource "Horizontally" (=> all in 1 same Row), or "Vertically" (=> all 1 one same Column).
Vertically. Only 1 column.

I have read your examples you provided me, but due my low knowledge I can not understand them...
I think solution I need:

Code: Select all

Line 1 of DIRECTIONS.txt to Line 1 of LINKMAP.txt
Line 2 of DIRECTIONS.txt to Line 2 of LINKMAP.txt
Line 3 of DIRECTIONS.txt to Line 3 of LINKMAP.txt
Line 4 of DIRECTIONS.txt to Line 4 of LINKMAP.txt
Line 5 of DIRECTIONS.txt to Line 5 of LINKMAP.txt
and so on...
is very simple to write by who know macro lenguge. But for me is not possible make it...

Please, let me know if you can help me.
But.., pfff, what you want is not very complicated, you've been using iMacros for about 2 years..., I was doing the same kind of Script like you want 3 hours after I had discovered iMacros for the first time, hum..., about 10 years ago now already, oops...! :oops:

Try to make/keep "Things" as "Simple" as "Possible"..., think in 2D-3D-4D-...-nD to model your Project, or in Colours like I do, with only 3 Colours you can already cover up to 7D, that's usually more-more than enough for any "Project" and if necessary up to 27D, simply colouring the Principle of a "Relational Database" placed inside an Array of Arrays of Arrays of... :idea:
=> Keeping Things as simple as possible means lowering the Dimensions, => Use only one Linear DataSource, Horizontal/Vertical doesn't really make a Difference, I would go for 1 Col per Map and its Set of Directions... :idea:

You only need to remember 4 Formulas to solve the Rubik's Cube from any Random Position, and automating any Web-Task with iMacros is even easier...! 8)
- (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...
giuseppe
Posts: 40
Joined: Sat Oct 15, 2016 3:30 pm

Re: How fill field of a form using file stored in DATASOURCE

Post by giuseppe » Wed Jul 04, 2018 7:54 pm

Hi, you given me an interesting solution sayng me:
Use only one Linear DataSource, Horizontal/Vertical doesn't really make a Difference, I would go for 1 Col per Map and its Set of Directions... :idea:
But before find a solution for that, I need resolve another problem...

I explain you.
Due to NO ACCESS to my map (I do not know way... they are with public access...). So I have creted 3 CONTACT form open to the public.
There are not difference between maps or forms. The problem is the same...
What is the problem? Follow I explain it...
I have registered a macro filling the field of contact form A and B.
Resultate is the follow
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=https://docs.google.com/forms/d/e/1FAIp ... w/viewform
TAG POS=1 TYPE=TEXTAREA FORM=ID:mG61Hd ATTR=NAME:entry.586383421 CONTENT=Texte<SP>into<SP>field<SP>A1
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:mG61Hd ATTR=NAME:entry.1267468769 CONTENT=Text<SP>into<SP>field<SP>A2
TAG POS=1 TYPE=TEXTAREA FORM=ID:mG61Hd ATTR=NAME:entry.840338757 CONTENT=Text<SP>into<SP>field<SP>A3
TAG POS=1 TYPE=SPAN ATTR=TXT:Invia
TAB T=1
URL GOTO=https://docs.google.com/forms/d/e/1FAIp ... A/viewform
TAG POS=1 TYPE=TEXTAREA FORM=ID:mG61Hd ATTR=NAME:entry.1144922934 CONTENT=Text<SP>into<SP>field<SP>B1
TAG POS=1 TYPE=TEXTAREA FORM=ID:mG61Hd ATTR=NAME:entry.2026098938 CONTENT=Text<SP>into<SP>field<SP>B2
TAG POS=1 TYPE=TEXTAREA FORM=ID:mG61Hd ATTR=NAME:entry.2001997549 CONTENT=Text<SP>into<SP>field<SP>B3
TAG POS=1 TYPE=SPAN ATTR=TXT:Invia
I can see that when I click into each field to introduce text/comment, the code of the macro include differents special ID for each field.
ATTR=NAME:entry.586383421
ATTR=NAME:entry.1144922934
and so on...

So, if now I want fill CONTACT FORM C introducing in the macro the URL of CONTACT FORM C If I don't have the code for each field I can not make macro.

I undestand that each field must have an ID so macro can go to the correct field. But maybe there is a solution for example sayng to imacro to go to the FIRST field find in the web page from up to down.
And after to go to the second field find in the web page from up to down.
and so on...
Maybe it is not possible... I do not know...
So I ask to you in order to understand if there is a way to define a general code for differents CONTACT FORM but all of them with th same structure.

Please, let me know.
Thanks for your support.
Last edited by giuseppe on Wed Jul 04, 2018 8:49 pm, edited 1 time in total.
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 8195
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How fill field of a form using file stored in DATASOURCE

Post by chivracq » Wed Jul 04, 2018 8:20 pm

giuseppe wrote:Hi, you given me an interesting solution sayng me:
Use only one Linear DataSource, Horizontal/Vertical doesn't really make a Difference, I would go for 1 Col per Map and its Set of Directions... :idea:
But before find a solution for that, I need resolve another problem...

I explain you.
Due to NO ACCESS to my map (I do not know way... they are with public access...). So I have creted 3 CONTACT form open to the public.
https://docs.google.com/forms/d/e/1FAIp ... w/viewform
https://docs.google.com/forms/d/e/1FAIp ... A/viewform
ttps://docs.google.com/forms/d/e/1FAIpQLSdjaR64bLUXPv5bc0QwopH6n-BFEkcKVd-Xvle4TWfgKZ0jAQ/viewform
There are not difference between maps or forms. The problem is the same...
What is the problem? Follow I explain it...
I have registered a macro filling the field of contact form A and B.
Resultate is the follow

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=https://docs.google.com/forms/d/e/1FAIpQLSf1Ox-QZq_siHbgzLr-GZsgh0OTUL0yxrOPQJQ8ioS-yQEW4w/viewform
TAG POS=1 TYPE=TEXTAREA FORM=ID:mG61Hd ATTR=NAME:entry.586383421 CONTENT=Texte<SP>into<SP>field<SP>A1
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:mG61Hd ATTR=NAME:entry.1267468769 CONTENT=Text<SP>into<SP>field<SP>A2
TAG POS=1 TYPE=TEXTAREA FORM=ID:mG61Hd ATTR=NAME:entry.840338757 CONTENT=Text<SP>into<SP>field<SP>A3
TAG POS=1 TYPE=SPAN ATTR=TXT:Invia
TAB T=1
URL GOTO=https://docs.google.com/forms/d/e/1FAIpQLSdyp3obJRPm-5VTsGwx8tE7YQr8swFQ0HUnKIPo7tppb0g1UA/viewform
TAG POS=1 TYPE=TEXTAREA FORM=ID:mG61Hd ATTR=NAME:entry.1144922934 CONTENT=Text<SP>into<SP>field<SP>B1
TAG POS=1 TYPE=TEXTAREA FORM=ID:mG61Hd ATTR=NAME:entry.2026098938 CONTENT=Text<SP>into<SP>field<SP>B2
TAG POS=1 TYPE=TEXTAREA FORM=ID:mG61Hd ATTR=NAME:entry.2001997549 CONTENT=Text<SP>into<SP>field<SP>B3
TAG POS=1 TYPE=SPAN ATTR=TXT:Invia
I can see that when I click into each field to introduce text/comment, the code of the macro include differents special ID for each field.

Code: Select all

ATTR=NAME:entry.586383421
ATTR=NAME:entry.1144922934
and so on...
So, if now I want fill CONTACT FORM C introducing in the macro the URL of CONTACT FORM C If I don't have the code for each field I can not make macro.

I undestand that each field must have an ID so macro can go to the correct field. But maybe there is a solution for example sayng to imacro to go to the FIRST field find in the web page from up to down.
And after to go to the second field find in the web page from up to down.
and so on...
Maybe it is not possible... I do not know...
So I ask to you in order to understand if there is a way to define a general code for differents CONTACT FORM but all of them with th same structure.

Please, let me know.
Thanks for your support.
Yep..., very "common" for many Sites, simply remove the Dynamic part of the ID/Name and replace it with a Wildcard, and adjust the 'POS=1' to '=1'/'=2'/'=3'..., or use 'Relative Positioning' on each "Field A1" etc corresponding Label...

One of your Links for the Forms (Form C) is incomplete btw, the starting "h" is missing for the URL...
- (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...
giuseppe
Posts: 40
Joined: Sat Oct 15, 2016 3:30 pm

Re: How fill field of a form using file stored in DATASOURCE

Post by giuseppe » Wed Jul 04, 2018 9:04 pm

Hi, thanks for your reply.
Unfortunatelly I do not understand when you say:
"remove the Dynamic part of the ID/Name and replace it with a Wildcard"
What wildcard I should use? What is a wildcard in informatic world? Sorry but I do not understand...
Also when you say: "adjust the 'POS=1' to '=1'/'=2'/'=3'" what mean it?

In my case the line:
TAG POS=1 TYPE=TEXTAREA FORM=ID:mG61Hd ATTR=NAME:entry.1144922934 CONTENT=Text<SP>into<SP>field<SP>B1
How I need convert it? Maybe in the follow code?
TAG =1 TYPE=TEXTAREA FORM=Wildcard ATTR=NAME:Wildcard CONTENT=Text<SP>into<SP>field<SP>B1
But in WILDCARD what I need introduce...
Can you provide correct code? I understand nothing... sorry....
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 8195
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How fill field of a form using file stored in DATASOURCE

Post by chivracq » Wed Jul 04, 2018 10:13 pm

giuseppe wrote:Hi, thanks for your reply.
Unfortunatelly I do not understand when you say:
"remove the Dynamic part of the ID/Name and replace it with a Wildcard"
What wildcard I should use? What is a wildcard in informatic world? Sorry but I do not understand...
Also when you say: "adjust the 'POS=1' to '=1'/'=2'/'=3'" what mean it?

In my case the line:

Code: Select all

TAG POS=1 TYPE=TEXTAREA FORM=ID:mG61Hd ATTR=NAME:entry.1144922934 CONTENT=Text<SP>into<SP>field<SP>B1
How I need convert it? Maybe in the follow code?

Code: Select all

TAG =1 TYPE=TEXTAREA FORM=Wildcard ATTR=NAME:Wildcard CONTENT=Text<SP>into<SP>field<SP>B1
But in WILDCARD what I need introduce...
Can you provide correct code? I understand nothing... sorry....
Hum, OK, you've been using iMacros for 1.5 nearly 2 years now already but you are really lacking some very Basic Knowledge of iMacros, you should read a bit of the Documentation sometimes, and read from time to time a few Pages of Threads on the Forum, that's the best way to learn a bit by yourself... :shock:

A Wildcard is (*)...

But OK, the following mini-Script will probably work on all 3 Forms:

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
'URL GOTO=https://docs.google.com/forms/d/e/1FAIpQLSf1Ox-QZq_siHbgzLr-GZsgh0OTUL0yxrOPQJQ8ioS-yQEW4w/viewform
TAG POS=1 TYPE=TEXTAREA ATTR=NAME:entry.* CONTENT=Text<SP>into<SP>field<SP>1
TAG POS=2 TYPE=TEXTAREA ATTR=NAME:entry.* CONTENT=Text<SP>into<SP>field<SP>2
TAG POS=3 TYPE=TEXTAREA ATTR=NAME:entry.* CONTENT=Text<SP>into<SP>field<SP>3
TAG POS=1 TYPE=SPAN ATTR=TXT:Invia
(Not tested...)

>>>

Hum, OK, I checked myself anyway (on iMacros for FF v8.8.2, Pale Moon v8.8.2 (=FF47), Win10_x64.), and it works indeed, at least on Forms 'B' and 'C', and on Form 'A' you defined the 2nd Field indeed a bit differently in the Form, like was already visible from the Script you had posted for the first 2 Forms...
- (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...
giuseppe
Posts: 40
Joined: Sat Oct 15, 2016 3:30 pm

Re: How fill field of a form using file stored in DATASOURCE

Post by giuseppe » Sat Jul 07, 2018 11:17 pm

Hi,
good, it work well. Thanks for clarify about willcarrd.

I'd like also to clarify some information about me, so you will understand more about me.

When you say:
you've been using iMacros for 1.5 nearly 2 years now already but you are really lacking some very Basic Knowledge of iMacros, you should read a bit of the Documentation sometimes, and read from time to time a few Pages of Threads on the Forum, that's the best way to learn a bit by yourself...
I registered to this forum 2 years ago, but I have not used imacro in this 2 years. Maybe I used imacro the first month, and due to my work I did'nt use imacro in the last 2 years.
Say that, I'd like also clarify some things more:
1. My english is very bud. Each day I improve it, but I do not use english in my work and in general in 99,9% of my life. I only use english with you and with some other people. So I improve english but very slowly... But I'd like learn so I will continue improving english :)
2. I am not informatic. I understand nothing about programation. When I say nothing it means "nothing"
Combination between 1 and 2 is the reason of my lack ability with imacro. I have read a lot of thread in this forum, but I only am able to understand only 10% of information. For example you provided me some link in your previously reply, but I was no able to use information of this links....

But off course I'd like learn, even if with my work I have no time to spend learning... Also I have a dothar and a wife, and I love to stay with them. But even if I have very very very litle time I'd like learn more about imacro. So I will ask you a few question. I hope you will reply me:

1. Where I can find basic information about imacro? Can you provide me some text document (or video) that can help me to start with imacro?
2. What lenguage use imacro
3. I resolved the 90% of the problem explaned in this thread. But there is one thing without a solution. I asked you if there is a way to introduce a variable to the number of LOOP. I explan well. For the follow macro
var SecondMacro = "";
SecondMacro = "CODE:";
SecondMacro += "TAB T=1" + "\n";
SecondMacro += "SET !ERRORIGNORE YES" + "\n";
SecondMacro += "SET !TIMEOUT_PAGE 10" + "\n";
SecondMacro += "SET !DATASOURCE LINKMAP.txt" + "\n";
SecondMacro += "SET !DATASOURCE_COLUMNS 1" + "\n";
SecondMacro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
SecondMacro += "URL GOTO={{!COL1}}" + "\n";

iimPlay(FirstMacro);

for(var i=1; i<=5; i++)
{
iimSet("LOOPNUM", i)
iimPlay(SecondMacro);
}
I setted i<=5 But in my txt some time I have 5 lines, some time 7, some time 3... It means I need every time to edit macro and change value of "i".
I thought a good solution is the function IF. Concretelly macro in "i<=5" should say: "if no more line on LINKMAP.txt stop macro".
I am not sure if that is possible... Maybe it is not possible... Maybe the function IF is not possible with imacro....
In your previously reply, in order to resolve this problem, you suggested me another solution. Solution you provided was extract the number of line in the txt. I am looking if there is some information on the web about that, but I was not able to find it... Unfortunatelly my bud english do not help me to make a good research on the web.... :(

In conclusion I do not know if the best solution is use my solution
a) Use the funcion IF (if no more line stop macro)
Or use your solution
b) look for number of lines included in file

But I do not find information for solution a neither for solution b....

Say that, I ask you if you can help me to resolve this problem. My txt file contein link in vertical way (1 column)

I hope your reply about my 3 questions.

One thing more, thanks for your support and for your patient :)
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 8195
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How fill field of a form using file stored in DATASOURCE

Post by chivracq » Sun Jul 08, 2018 12:34 am

giuseppe wrote:Hi,
good, it work well. Thanks for clarify about willcarrd.

I'd like also to clarify some information about me, so you will understand more about me.

When you say:
you've been using iMacros for 1.5 nearly 2 years now already but you are really lacking some very Basic Knowledge of iMacros, you should read a bit of the Documentation sometimes, and read from time to time a few Pages of Threads on the Forum, that's the best way to learn a bit by yourself...
I registered to this forum 2 years ago, but I have not used imacro in this 2 years. Maybe I used imacro the first month, and due to my work I did'nt use imacro in the last 2 years.
Say that, I'd like also clarify some things more:
1. My english is very bud. Each day I improve it, but I do not use english in my work and in general in 99,9% of my life. I only use english with you and with some other people. So I improve english but very slowly... But I'd like learn so I will continue improving english :)
2. I am not informatic. I understand nothing about programation. When I say nothing it means "nothing"
Combination between 1 and 2 is the reason of my lack ability with imacro. I have read a lot of thread in this forum, but I only am able to understand only 10% of information. For example you provided me some link in your previously reply, but I was no able to use information of this links....

But off course I'd like learn, even if with my work I have no time to spend learning... Also I have a dothar and a wife, and I love to stay with them. But even if I have very very very litle time I'd like learn more about imacro. So I will ask you a few question. I hope you will reply me:

1. Where I can find basic information about imacro? Can you provide me some text document (or video) that can help me to start with imacro?
2. What lenguage use imacro
3. I resolved the 90% of the problem explaned in this thread. But there is one thing without a solution. I asked you if there is a way to introduce a variable to the number of LOOP. I explan well. For the follow macro

Code: Select all

var SecondMacro = "";
SecondMacro = "CODE:";
SecondMacro += "TAB T=1" + "\n";
SecondMacro += "SET !ERRORIGNORE YES" + "\n";
SecondMacro += "SET !TIMEOUT_PAGE 10" + "\n";
SecondMacro += "SET !DATASOURCE LINKMAP.txt" + "\n";
SecondMacro += "SET !DATASOURCE_COLUMNS 1" + "\n";
SecondMacro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
SecondMacro += "URL GOTO={{!COL1}}" + "\n";

iimPlay(FirstMacro);

for(var i=1; i<=5; i++)
{
iimSet("LOOPNUM", i)
iimPlay(SecondMacro);
}
I setted i<=5 But in my txt some time I have 5 lines, some time 7, some time 3... It means I need every time to edit macro and change value of "i".
I thought a good solution is the function IF. Concretelly macro in "i<=5" should say: "if no more line on LINKMAP.txt stop macro".
I am not sure if that is possible... Maybe it is not possible... Maybe the function IF is not possible with imacro....
In your previously reply, in order to resolve this problem, you suggested me another solution. Solution you provided was extract the number of line in the txt. I am looking if there is some information on the web about that, but I was not able to find it... Unfortunatelly my bud english do not help me to make a good research on the web.... :(

In conclusion I do not know if the best solution is use my solution
a) Use the funcion IF (if no more line stop macro)
Or use your solution
b) look for number of lines included in file

But I do not find information for solution a neither for solution b....

Say that, I ask you if you can help me to resolve this problem. My txt file contein link in vertical way (1 column)

I hope your reply about my 3 questions.

One thing more, thanks for your support and for your patient :)
I'll read and reply to your Reply a bit later, Sa. evening, big Party, I'm a DJ IRL...

But hum..., from quick scan-reading, I noticed this part:
1. Where I can find basic information about imacro?
=> Then I would think..., oewdy-oewdy-Darling-Darling...!! (don't get scared, my "Specialty" as a "Creative" sbd to "create" new Words when I feel like it, ah-ah...! :wink: ), and you registered already nearly 2 years ago on the Forum...!? :roll:

OK, I'll read the whole Reply after m Party / tomorrow / when I have a chance..., oops, I'm not allowed on the PC anymore..., oops...!
- (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...
giuseppe
Posts: 40
Joined: Sat Oct 15, 2016 3:30 pm

Re: How fill field of a form using file stored in DATASOURCE

Post by giuseppe » Sun Jul 08, 2018 7:05 am

Hi DJ IRL,
nice to know more about you.
Are you that?
https://soundcloud.com/num1fun
There is only one track. Please, send me more link with your music.
I hope party was a super party... ahahhaha

Don't worry, Fill free to reply when you find free times.
In order to understand, do you work with ipswitch?
I ask for that because Only you reply to 99,99% of post in this forum.
I ask for that only to understand what is your rule in imacro.

Have a good day.
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 8195
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How fill field of a form using file stored in DATASOURCE

Post by chivracq » Sun Jul 08, 2018 7:45 am

giuseppe wrote:Hi DJ IRL,
nice to know more about you.
Are you that?
https://soundcloud.com/num1fun
There is only one track. Please, send me more link with your music.
I hope party was a super party... ahahhaha

Don't worry, Fill free to reply when you find free times.
In order to understand, do you work with ipswitch?
I ask for that because Only you reply to 99,99% of post in this forum.
I ask for that only to understand what is your rule in imacro.

Have a good day.
Ah-ah...!, not really my "Taste" your 'IRL DJ' Track, too "Kitschy-Funky" for me, and I don't like Auto-cued Voices/Vocals, beurk...!!, I'm more Ska/Rocakabilly/Balkan/ElectroSwing/ElectroPunk/ElectroTrance...

Nope, I don't work for Ipswich, even if I'm (the only) Mod on the Forum, don't worry, I'm completely "Independent" and I only "ventilate" my own Opinion, and I regularly bash (and clash with) TechSup, oops...! (Last "Example" earlier today, for example, if you are interested..., ah-ah...! :wink: )

I'm just an "Advanced" User who's been using iMacros for about 10 years (only '.iim' with FF) and my ["Rule" - sic!]/"Role" as Mod on the Forum is simply to prevent Spam on the Forum... (For 1 approved Post visible on the Forum, I often have to scan/check/control... and disapprove 19 Fake/Spam Posts...) For Threads I answer (Technically), I'm just an (Advanced) User helping other Users... 8)
- (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...
Post Reply