How to use Array Loop in iMacros? - imacros

VERSION BUILD=1005 RECORDER=CR
SET !ERRORIGNORE YES
URL GOTO=https://api.whatsapp.com/send?phone=923002021392&text=Great%20Offer%20For%20Karachites!%20Get%20a%20Free%20Squishy%20StressBall%20By%20Just%20Paying%20Rs%20200%20Delivery.%20Get%20your%20free%20Ball%20at:%20http://netlify.com/%20Have%20fun.
TAG POS=1 TYPE=A ATTR=TXT:Send
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=DATA-ICON:send&&CLASS:
URL GOTO=https://api.whatsapp.com/send?phone=923002021397&text=Great%20Offer%20For%20Karachites!%20Get%20a%20Free%20Squishy%20StressBall%20By%20Just%20Paying%20Rs%20200%20Delivery.%20Get%20your%20free%20Ball%20at:%20http://netlify.com/%20Have%20fun.
TAG POS=1 TYPE=A ATTR=TXT:Send
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=DATA-ICON:send&&CLASS:
URL GOTO=https://api.whatsapp.com/send?phone=923002025509&text=Great%20Offer%20For%20Karachites!%20Get%20a%20Free%20Squishy%20StressBall%20By%20Just%20Paying%20Rs%20200%20Delivery.%20Get%20your%20free%20Ball%20at:%20http://netlify.com/%20Have%20fun.
TAG POS=1 TYPE=A ATTR=TXT:Send
WAIT SECONDS=10
I have a list of 1000 Numbers, and I can't add more than 50 lines, how can I use an Array or Loop?
As you see that link has different phone numbers, I want those number to be taken from Array or txt files.

You can try the following code:
SET !VAR1 EVAL("[923002021392, 923002021397, 923002025509][{{!LOOP}} - 1];")
URL GOTO=https://api.whatsapp.com/send?phone={{!VAR1}}&text=Great%20Offer%20For%20Karachites!%20Get%20a%20Free%20Squishy%20StressBall%20By%20Just%20Paying%20Rs%20200%20Delivery.%20Get%20your%20free%20Ball%20at:%20http://netlify.com/%20Have%20fun.
TAG POS=1 TYPE=A ATTR=TXT:Send
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=DATA-ICON:send&&CLASS:
Play this macro repeatedly (in loop mode).Hope it helps.

Related

iMacros Extract DATA from Input Text

I want to extract data from an input Text through iMacros. Here is my code:
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:timeentry_total CONTENT=60
I tried using:
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:timeentry_total EXTRACT:TXT
This gives me 'wrong format' error.
What should I do?
Thanks
Fahad
Please change the format to
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:timeentry_total EXTRACT=TXT
Instead of
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:timeentry_total EXTRACT:TXT
As you can see, the only difference is that you are using : instead of = which is causing the issue!

How to Make Short Code for 100 TAG POS (iMacros)?

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
TAG POS=1 TYPE=A ATTR=aria-label:Options
TAG POS=1 TYPE=A ATTR=TXT:Delete
WAIT SECOND = 3
TAG POS=2 TYPE=A ATTR=aria-label:Options
TAG POS=2 TYPE=A ATTR=TXT:Delete
To...
TAG POS=100 TYPE=A ATTR=aria-label:Options
TAG POS=100 TYPE=A ATTR=TXT:Delete
Note : There are 100 rows on 1 page.
You need to use !LOOP and use the loop functionality of IMacros (It is under the repeat section of IMacros) and set the number of times to loop, the you need to press Play (Loop). Refer the below sample code!
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
SET !LOOP 1
TAG POS={{!LOOP}} TYPE=A ATTR=aria-label:Options
TAG POS={{!LOOP}} TYPE=A ATTR=TXT:Delete
WAIT SECOND = 3

How to give end loop value in imacro

I am unable to find any function or any things in imacro where i can define last number in loop i.e. up to when loop has to run, I have started loop from row number 2 and want to end loop on 1500 row, so how i can give this (1500) value in imacro instead of manual filling, sugget the best way if anyone have the same, coding is:
TAB T=1
SET !TIMEOUT_PAGE 999
SET !ERRORIGNORE YES
SET !DATASOURCE XXXXXX.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=NAME:search[order_nr] CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:NoFormName ATTR=*
TAG POS=1 TYPE=TD ATTR=TXT:{{!COL1}}
TAG POS=1 TYPE=SELECT FORM=ID:refund_form ATTR=ID:refund_method CONTENT=XXXxX
TAG POS=1 TYPE=TEXTAREA FORM=ID:refund_form ATTR=ID:remarks CONTENT=Done
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:refund_form ATTR=ID:submit
If you don't want to apply the Scripting Interface, try the following workaround:
TAB T=1
SET !TIMEOUT_PAGE 999
SET !ERRORIGNORE YES
SET !DATASOURCE XXXXXX.csv
SET startLoop 2
SET maxLoop 1500
SET !LOOP EVAL(1-{{maxLoop}}+{{startLoop}})
SET normLoop EVAL({{!LOOP}}+{{maxLoop}}-1)
SET !DATASOURCE_LINE {{normLoop}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=NAME:search[order_nr] CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:NoFormName ATTR=*
TAG POS=1 TYPE=TD ATTR=TXT:{{!COL1}}
TAG POS=1 TYPE=SELECT FORM=ID:refund_form ATTR=ID:refund_method CONTENT=XXXxX
TAG POS=1 TYPE=TEXTAREA FORM=ID:refund_form ATTR=ID:remarks CONTENT=Done
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:refund_form ATTR=ID:submit
Pay attention to the fact that you have to play this macro in usual (not loop) mode.

How to Make iMacros Run Data Entry Script for 100's of CSV's?

I have a script that will run the same exact process (pasting a list from a CSV into a text box), many times on the same web page, and I'm trying to get it to run the process one time for many CSV's in the working folder (1.csv, 2.csv, 3.csv,... 100.csv, etc).
Is it possible for iMacros to loop through the same script, only varying the input file (!DATASOURCE)?
I will name the CSV's numerically so the script can cycle through them easily.
Link to sample CSV (note: all keywords put into 1 cell so that it can be pasted as a list, one per line).
Example of how each CSV file's contents will be pasted as a list (one keyword per line):
I am new to iMacros and was hoping this would work, but it stops running on the 2nd loop, and throws the error:
TypeError: this.dataSource[(line - 1)] is undefined, line 14 (Error code: -1001)
Here is the code I have so far:
VERSION BUILD=8961227 RECORDER=FX
TAB T=1
SET !DATASOURCE {{!LOOP}}.csv
URL GOTO=https://sellercentral.amazon.com/hz/cm/adgroup/create?campaignId=A0478490D2AQYA9C8NTW
TAG POS=1 TYPE=DIV ATTR=ID:product-search-results
TAG POS=1 TYPE=INPUT:SEARCH FORM=ID:form-ad-group ATTR=ID:product-search-input CONTENT=product<SP>name
TAG POS=1 TYPE=BUTTON FORM=ID:form-ad-group ATTR=ID:product-search-button
TAG POS=1 TYPE=BUTTON FORM=ID:form-ad-group ATTR=TXT:Select
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form-ad-group ATTR=ID:txt-starting-bid CONTENT=1.25
TAG POS=1 TYPE=A ATTR=ID:tool-kw-ui-manual
TAG POS=1 TYPE=TEXTAREA FORM=ID:form-ad-group ATTR=ID:txt-keywords CONTENT={{!COL1}}
TAG POS=1 TYPE=DIV ATTR=TXT:Add<SP>these<SP>keywordsSaving...
Note:
I'm trying to automate data entry of a list, and since the data needed to be pasted one keyword per line, I had to save my list with notepad as a .csv and put quotation marks before the first keyword, and after the last keyword, so iMacros would recognize it as just 1 cell.
Just realized my approach was valid, just didn't realize I had to put the SET !DATASOURCE_LINE 1 after SET !DATASOURCE {{!LOOP}}.csv
The working code I have now looks like this:
VERSION BUILD=8961227 RECORDER=FX
TAB T=1
SET !DATASOURCE {{!LOOP}}.csv
SET !DATASOURCE_LINE 1
URL GOTO=https://sellercentral.amazon.com/hz/cm/adgroup/create?campaignId=A0478490D2AQYA9C8NTW
TAG POS=1 TYPE=DIV ATTR=ID:product-search-results
TAG POS=1 TYPE=INPUT:SEARCH FORM=ID:form-ad-group ATTR=ID:product-search-input CONTENT=product<SP>name
TAG POS=1 TYPE=BUTTON FORM=ID:form-ad-group ATTR=ID:product-search-button
TAG POS=1 TYPE=BUTTON FORM=ID:form-ad-group ATTR=TXT:Select
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form-ad-group ATTR=ID:txt-starting-bid CONTENT=1.25
TAG POS=1 TYPE=A ATTR=ID:tool-kw-ui-manual
TAG POS=1 TYPE=TEXTAREA FORM=ID:form-ad-group ATTR=ID:txt-keywords CONTENT={{!COL1}}
TAG POS=1 TYPE=DIV ATTR=TXT:Add<SP>these<SP>keywordsSaving...

iMacros loop based search and extract result

I am trying to build a macro that automatically search a Keyword from a CSV file and paste it in a search box then click on search button, when search result comes up then click on that result.So far I can go maximum click on search button and bring search result but I can't do later. Now What command should I put that macro so it clicks on the search result. Please see below images
Below is the code I am using:
VERSION BUILD=8810214 RECORDER=FX
TAB T=1
SET !DATASOURCE Extracts.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
SET !Extract_TEST_POPUP NO
URL GOTO=https://reports.zoho.com/ZDBDataSheetView.cc?DBID=302139000000984683
TAG POS=1 TYPE=DIV ATTR=ID:ZDBMainBox
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ZDBObjSearchTxtFld CONTENT= {{!COL1}}
wait seconds = 3
TAG POS=131 TYPE=DIV ATTR=TXT:
TAG POS=1 TYPE=A ATTR=ID:{{!COL1}}
Can anyone please help me to figure out the right command?
VERSION BUILD=8810214 RECORDER=FX
TAB T=1
SET !DATASOURCE Extracts.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
SET !Extract_TEST_POPUP NO
URL GOTO=https://reports.zoho.com/ZDBDataSheetView.cc?DBID=302139000000984683
TAG POS=1 TYPE=DIV ATTR=ID:ZDBMainBox
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ZDBObjSearchTxtFld CONTENT={{!COL1}}
wait seconds = 3
TAG POS=131 TYPE=DIV ATTR=TXT:
TAG POS=1 TYPE=A ATTR=TXT:*{{!COL1}}*
I tried this code and it worked. I replaced the ID with TXT in last line of the code.