how to make changeable sentence.....with SET !DATASOURCE_LINE

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
Post Reply
a2515125
Posts: 110
Joined: Tue Dec 06, 2016 3:37 am

how to make changeable sentence.....with SET !DATASOURCE_LINE

Post by a2515125 » Mon Apr 01, 2019 5:37 pm

PM28.4/windows 10/imacros 8.9.7

Hey I would like to make a sentence a title with the combination of different words in the same text-box in every loop

example:

hey I am "John" I am "17" from "New York City"

I would like to change only "name" & "age" &"city" in a sentence

I would like to use {{!COL1}}{{!COL2}}{{!COL3}} with SET !DATASOURCE_LINE (different and randomly)

but the script can only allow same SET !DATASOURCE_LINE if I put {{!COL1}}{{!COL2}}{{!COL3}} together...

how can I achieve different sentence by using {{!COL1}}{{!COL2}}{{!COL3}} with respectively different DATASOURCE_LINE

I want make the combination of 5 names / 1-32 ages / 15 cities

I want {{!COL1}} with random !DATASOURCE_LINE {{!VAR1}}
I want {{!COL2}} with random !DATASOURCE_LINE {{!VAR2}}
I want {{!COL3}} with random !DATASOURCE_LINE {{!VAR3}}

but {{!COL1}}{{!COL2}}{{!COL3}} in the same CONTENT


any idea?


here is my code

Code: Select all

SET !VAR1 EVAL ("var min = 1; var max = 5;var randomNumber = Math. floor (Math. random () * (max - min + 1))+ min; randomNumber; ")
SET !VAR2 EVAL ("var min = 1; var max = 32;var randomNumber = Math. floor (Math. random () * (max - min + 1))+ min; randomNumber; ")
SET !VAR3 EVAL ("var min = 1; var max = 15;var randomNumber = Math. floor (Math. random () * (max - min + 1))+ min; randomNumber; ")

'標題
SET !DATASOURCE_LINE {{!VAR1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=* CONTENT={{!COL1}}{{!COL2}}{{!COL3}}


Last edited by a2515125 on Tue Apr 02, 2019 4:48 am, edited 2 times in total.
chivracq
Posts: 8703
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: how to make changeable sentence.....with SET !DATASOURCE_LINE

Post by chivracq » Mon Apr 01, 2019 5:45 pm

a2515125 wrote:
Mon Apr 01, 2019 5:37 pm
Hey I would like to make a sentence a title with the combination of different words in the same text-box in every loop

example:

hey I am "John" I am "17" from "New York City"

I would like to change only "name" & "age" &"city" in a sentence

I would like to use {{!COL1}}{{!COL2}}{{!COL3}} with SET !DATASOURCE_LINE (different and randomly)

but the script can only allow same SET !DATASOURCE_LINE if I put {{!COL1}}{{!COL2}}{{!COL3}} together...

how can I achieve different sentence by using {{!COL1}}{{!COL2}}{{!COL3}} with respectively different DATASOURCE_LINE

I want make the combination of 5 names / 1-32 ages / 15 cities

I want {{!COL1}} with random !DATASOURCE_LINE {{!VAR1}}
I want {{!COL2}} with random !DATASOURCE_LINE {{!VAR2}}
I want {{!COL3}} with random !DATASOURCE_LINE {{!VAR3}}

but {{!COL1}}{{!COL2}}{{!COL3}} in the same CONTENT


any idea?


here is my code

Code: Select all

SET !VAR1 EVAL ("var min = 1; var max = 5;var randomNumber = Math. floor (Math. random () * (max - min + 1))+ min; randomNumber; ")
SET !VAR2 EVAL ("var min = 1; var max = 32;var randomNumber = Math. floor (Math. random () * (max - min + 1))+ min; randomNumber; ")
SET !VAR3 EVAL ("var min = 1; var max = 15;var randomNumber = Math. floor (Math. random () * (max - min + 1))+ min; randomNumber; ")

'標題
SET !DATASOURCE_LINE {{!VAR1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=* CONTENT={{!COL1}}{{!COL2}}{{!COL3}}
Yep, you are close... :o
A little bit more "Thinking" and you should find the/a Solution by yourself... :wink:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
a2515125
Posts: 110
Joined: Tue Dec 06, 2016 3:37 am

Re: how to make changeable sentence.....with SET !DATASOURCE_LINE

Post by a2515125 » Tue Apr 02, 2019 3:16 am

I failed that is why I post it............. :?:
please give me some clues or tip to achieve it ^^"
chivracq
Posts: 8703
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: how to make changeable sentence.....with SET !DATASOURCE_LINE

Post by chivracq » Tue Apr 02, 2019 3:51 am

a2515125 wrote:
Tue Apr 02, 2019 3:16 am
I failed that is why I post it............. :?:
please give me some clues or tip to achieve it ^^"
Beh..., nope..., I won't help you anymore..., as I asked you to put a Descriptive Title to your previous Thread, which you apparently found a bit "funny", OK why not..., but you didn't comply..., and wanted to delete your Thread instead of sharing your Solution (which you still "vaguely" did luckily). :shock:
I only help Users using the Forum "a bit correctly", and Descriptive Thread Title + FCI mentioned + Sharing their Solution are 3 of my "Criteria"... :wink:

+ Question Mark missing in the Thread Title for this current Thread (you are not sharing a 'How-To'...), OK, no "big deal", could be easily solved, (and the Thread Title is at least perfectly Descriptive "this time", good...!), FCI not mentioned (again!, while I've already asked you maybe 20 times..., so I'm a bit tired of asking...).
And I don't help anyway for the "Functionality" that you want in this current Thread as it is typically used by Spammers or for Social Media with "fake" Comments, which I definitely don't support, oops...! :shock:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
a2515125
Posts: 110
Joined: Tue Dec 06, 2016 3:37 am

Re: how to make changeable sentence.....with SET !DATASOURCE_LINE

Post by a2515125 » Tue Apr 02, 2019 4:38 am

Descriptive Thread Title + FCI mentioned + Sharing their Solution

already change the title of previous thread!!

add FCI already

I am willing to share our solution or relative link on my posts....of coursea

I ask for delete my post is because I think it can avoid you to answer me again

if you prefer I leave the post I will follow the rule.

BTW I use this code to post my products not to scam...
a2515125
Posts: 110
Joined: Tue Dec 06, 2016 3:37 am

Re: how to make changeable sentence.....with SET !DATASOURCE_LINE

Post by a2515125 » Tue Apr 02, 2019 5:08 am

I may to do it in one row of csv file with

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=* CONTENT={{!COL{{!VAR1}}}}{{!COL{{!VAR2}}}}{{!COL{{!VAR3}}}}
but that is not what I want.... my data is vertical in .csv

Name1 Age1 City1
Name2 Age2 City2
Name3 Age3 City3
a2515125
Posts: 110
Joined: Tue Dec 06, 2016 3:37 am

Re: how to make changeable sentence.....with SET !DATASOURCE_LINE

Post by a2515125 » Tue Apr 02, 2019 6:07 am

I do not know how to use TAG mode to achieve my combination ....if anyone know how to achieve with TAG MODE PLEASE LET ME KNOW BIG THANKS...

BUT EVENT MODE works...here is the solution

Code: Select all


SET !DATASOURCE_LINE {{!VAR1}}
EVENTS TYPE=KEYPRESS SELECTOR="#root>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>SECTION>FIELDSET>DIV>DIV>DIV>FORM>SPAN>INPUT" CHARS={{!COL1}}

SET !DATASOURCE_LINE {{!VAR2}}
EVENTS TYPE=KEYPRESS SELECTOR="#root>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>SECTION>FIELDSET>DIV>DIV>DIV>FORM>SPAN>INPUT" CHARS={{!COL2}}

SET !DATASOURCE_LINE {{!VAR3}}
EVENTS TYPE=KEYPRESS SELECTOR="#root>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>SECTION>FIELDSET>DIV>DIV>DIV>FORM>SPAN>INPUT" CHARS={{!COL3}}


Post Reply