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
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
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 9:03 am

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...
Really good what you love. It is more interesting than the other track :) So the party of yesterday was very interesting :)
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 do not understand very well what you say in thread due to my bud english and low (non-existent...) informatic knowledge. But it look like you are angry with them... very angry...
So if you do not work for ipswich, do you work only as DJ? Or are you freeland informatic?
Sorry for ask more about you... Is right only to understand wich who person I speack. For your interest I am engenier in water solutions :)
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)
Ok. I understand. You are ONG imacro :)
So I can only give you 1000 thanks to help me and the others users involved in imacro problems.

When you have 5 minuts free, please, reply me to my 3 questions I asked in my previously post.
I hope your reply. Thanks one thing more for your support.
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
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 14, 2018 7:37 am

Hi DJ IRL,
Have you news about how resolve the problem I posted in this thread?
Follow I past my queston because this thread will stard with one question but now continue with another question... and there are a lot of reply...
I explain follow my question:

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. Thanks for your support.
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 10301
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 15, 2018 1:07 am

Yeah OK, yep indeed, but hum..., find out first what my Smiley means in your next Thread..., I don't like repeating/asking twice (or more!) for the same things... :idea:
- (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...
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 15, 2018 6:58 am

Hi, I updated mentioned thread and I provided CIM.
Sorry for this inconvenient...
The fact of forgetting CIM I hope will not deteriorate our sighted relationship :oops: :mrgreen:
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 10301
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 15, 2018 5:51 pm

giuseppe wrote:Hi, I updated mentioned thread and I provided CIM.
Sorry for this inconvenient...
The fact of forgetting CIM I hope will not deteriorate our sighted relationship :oops: :mrgreen:
Yeah, good-good..., last time I was asking I think, like explained in my Sig, I usually don't react to or stop answering Threads if FCI is not mentioned, especially if I've already asked several times...
giuseppe wrote:Hi DJ IRL,
Have you news about how resolve the problem I posted in this thread?
Follow I past my queston because this thread will stard with one question but now continue with another question... and there are a lot of reply...
I explain follow my question:

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. Thanks for your support.
OK, this was your last Post/Script, I had to more or less read the whole Thread again, it's taking a bit long, the Thread was already started about 3 weeks ago I see, I've been "working" on quite a few other Scripts from some other Threads that were opened on the Forum in those 3 weeks, so I didn't know anymore exactly what your Thread was about... :wink:

Yeah, well, your 'for' Loop will be Dynamic, a bit like in this Thread I think, or this one maybe... From the first Thread I link to, think of using a 'while' or 'until' Loop instead of a 'for' Loop and by checking for the next Row in your DataSource if your Script can still expect some Input Data...

But hum...,, a little bit like a bit further in the 2nd Thread, if you are not very "Advanced" with iMacros and Programming, I think your Scenario would be easier in pure '.iim' rather than with a '.js' Script that will only work on FF with v8.9.7 or v9.0.3, even in FF, '.js' Scripts are not supported anymore in v10 if you ever want to update FF above FF57+, and your next Thread was about iMacros for CR, so you seem to be moving to CR anyway...
And about implementing your Scenario in pure '.iim', I had given you at the beginning of your Thread some Link to some Thread about a very similar Scenario like yours, I thought..., a bit surprised you didn't do anything with that Thread/Script, that User managed to implement their Scenario pretty quickly and easily in pure '.iim' with just a few Instructions/Suggestions from me... 8)
- (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...
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 15, 2018 11:01 pm

Hi, in the other thread I ask about imacro for CHROME because I have another computer and in this other computer I use CHROME. But all my macros are in .js and if .js is not supported for imacros with version 10 I will not change my macros because it can convert me in a crazy man...
Maybe in two years fire fox browser will be not compatible with some webpage and I will need update it. It means I will need update also imacros to version 10+ and it mean I can not use .js. So only in this moment (in two years or I hope more than 2 years...) I will change all my macros.
But at this moment I will continue with version 9. I will not do any change of version.
Say that I have read another time all replyes of my thread.
Maybe I should use somethingh like:
SET !var EVAL("var x = \"{{!var2}}\"; if(x>4){x=1;} else{x=0;}; x;")
It is a copy paste of one of your thread...
But for me is not possible make something running due to my low knowledge...

I think I shoukd introduce previously code here
for(var i=1; i<=5; i++)
{
iimSet("LOOPNUM", i)
iimPlay(SecondMacro);
}
But I am not sure... and of course if I do only one stupid error in code, macro will not run. That will be the situation with more probability of happen...

So if you can help me, if it is not so complicated, please provide me the correct code I should introduce.

Also, please, what lenguage is this code?
for(var i=1; i<=5; i++)
{
iimSet("LOOPNUM", i)
iimPlay(SecondMacro);
}
I'd like to know what lenguage it is so I can contact with some of my friends and explain this problem. But I need know what type of lenguage it is. So my friend will look in some manual of write the correct code.

But of course, If solution is very simple and you can provide in one minut a code I can copy paste to my macro, I will aprecite it.

I hope your reply.
Thanks for support.
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 10301
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 15, 2018 11:30 pm

giuseppe wrote:Hi, in the other thread I ask about imacro for CHROME because I have another computer and in this other computer I use CHROME. But all my macros are in .js and if .js is not supported for imacros with version 10 I will not change my macros because it can convert me in a crazy man...
Maybe in two years fire fox browser will be not compatible with some webpage and I will need update it. It means I will need update also imacros to version 10+ and it mean I can not use .js. So only in this moment (in two years or I hope more than 2 years...) I will change all my macros.
But at this moment I will continue with version 9. I will not do any change of version.
Say that I have read another time all replyes of my thread.
Maybe I should use somethingh like:

Code: Select all

SET !var EVAL("var x = \"{{!var2}}\"; if(x>4){x=1;} else{x=0;}; x;")
It is a copy paste of one of your thread...
But for me is not possible make something running due to my low knowledge...

I think I shoukd introduce previously code here

Code: Select all

for(var i=1; i<=5; i++)
{
iimSet("LOOPNUM", i)
iimPlay(SecondMacro);
}
But I am not sure... and of course if I do only one stupid error in code, macro will not run. That will be the situation with more probability of happen...

So if you can help me, if it is not so complicated, please provide me the correct code I should introduce.

Also, please, what lenguage is this code?

Code: Select all

for(var i=1; i<=5; i++)
{
iimSet("LOOPNUM", i)
iimPlay(SecondMacro);
}
I'd like to know what lenguage it is so I can contact with some of my friends and explain this problem. But I need know what type of lenguage it is. So my friend will look in some manual of write the correct code.

But of course, If solution is very simple and you can provide in one minut a code I can copy paste to my macro, I will aprecite it.

I hope your reply.
Thanks for support.
Yeah well, nobody knows how "Internet" will look like in 2 year time, nor iMacros specifically, many things can have changed by that time, ah-ah...!

For your Script, nope, can't do it in 1 min, you need to have a "Strategy" on how to implement your Scenario, a "Typical" Task for an "Engineer" I would think... :wink:
(And I don't, or very rarely, write Scripts for other Users anyway...)

Well, "what Language", you use '.js' Scripts, you should know that those are "JavaScript" Scripts, with the 'for' in your mini-Sample being a "Native" JS Command/Statement, while the 2 'iimSet()' and 'iimPlay()' are iMacros JS Commands...
I've already mentioned it, but you should really one day read a little bit of the Documentation, you would understand everything much-much easier...! :idea:
- (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...
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 » Mon Jul 16, 2018 12:01 am

Hi,
when you say me read documentation, do you refer to this link:
https://wiki.imacros.net/Sample_Code

Or to other link. Please, if you refer to other link, please copy and paste it here.

Say that I have one question more: the function
IF THOSE ELSE I should write, it should be write in js?
Or maybe it should be a combination between js an imacro code?

I also will write to the follow post:
https://forum.imacros.net/viewtopic.php ... 354#p71354
where techimac provided me this code. Maybe it can help me...
CIM are:
iMacros Firefox 9.0.3 / Browser Firefox 52.2.1 / Windows Vista
chivracq
Posts: 10301
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 » Mon Jul 16, 2018 12:42 am

giuseppe wrote:Hi,
when you say me read documentation, do you refer to this link:
https://wiki.imacros.net/Sample_Code

Or to other link. Please, if you refer to other link, please copy and paste it here.

Say that I have one question more: the function
IF THOSE ELSE I should write, it should be write in js?
Or maybe it should be a combination between js an imacro code?

I also will write to the follow post:
https://forum.imacros.net/viewtopic.php ... 354#p71354
where techimac provided me this code. Maybe it can help me...
Yeah, well, "Documentation" = the whole Wiki, not only that one single Page about "Sample Codes" for the 'Scripting Interface' that you don't even use...!
That specific Page is maybe 1% of the Wiki, now you still have 99% of the "rest" to read, ah-ah...! :wink:

Yep, Conditional Logic is "normally" implemented in ',js', that's the "Standard" way indeed...
I "developed" another way in pure '.iim' that you probably already know about as you posted some Script supposed to come from one of "my Threads", here is one "main" Thread that I sometimes update with "interesting"/relevant Threads/Examples, that you should know actually, after 2 years on the Forum, I would think...:
- Workarounds for Conditional Logic in Macro Code

Yeah well, good luck with @techimac ah-ah...!, I stopped helping this (Semi-Advanced) User several months ago, ah-ah...! :P
- (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