Shortcut link to send multiple commands in 1 link - html

How to turn below into a complete link ?
below are from imacro
TAG POS=1 TYPE=SELECT FORM=ACTION:index.php ATTR=NAME:combatSetId CONTENT=%355181
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:index.php ATTR=NAME:submit

Related

Copy/Paste through tabs on Chrome with iMacros?

'part 1 - copy session
SET !EXTRACT_TEST_POPUP NO
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:product-form ATTR=ID:Name EXTRACT=TXT
SET !VAR1 EVAL("\"{{!EXTRACT}}\".replace(/a'/g, \"à\") .replace(/e'/g, \"è\") .replace(/i'/g, \"ì\") .replace(/o'/g, \"ò\") .replace(/u'/g, \"ù\") .replace(/A'/g, \"À\") .replace(/E'/g, \"È\") .replace(/I'/g, \"Ì\") .replace(/O'/g, \"Ò\") .replace(/U'/g, \"Ù\")")
SET !EXTRACT NULL
TAG POS=1 TYPE=A ATTR=TXT:EN
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:product-form ATTR=ID:Locales_1__Name EXTRACT=TXT
SET !VAR2 {{!EXTRACT}}
SET !EXTRACT NULL
WAIT SECONDS=2.0
'part 2 - paste session
TAG POS=1 TYPE=A ATTR=TXT:IT
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:product-form ATTR=ID:Locales_0__Name CONTENT={{!VAR1}}
etc
etc
etc
This is the first part of code I used until now.
Now I need to copy my source text from another tab of chrome in order to make this one the {{!VAR1}} which will be pasted all over the textboxes in another tab.
TAB T=1
FRAME F=2
TAG POS=1 TYPE=DIV ATTR=CLASS:MagicZoomHeader EXTRACT=TXT
SET !VAR1 EVAL("\"{{!EXTRACT}}\".replace(/a'/g, \"à\") .replace(/e'/g, \"è\") .replace(/i'/g, \"ì\") .replace(/o'/g, \"ò\") .replace(/u'/g, \"ù\") .replace(/A'/g, \"À\") .replace(/E'/g, \"È\") .replace(/I'/g, \"Ì\") .replace(/O'/g, \"Ò\") .replace(/U'/g, \"Ù\")")
SET !EXTRACT NULL
TAB T=2
This is the code which extract the text I need from TAB 1.
In order to do this, I write the code using TAB T=1 (to copy and create the first VAR) and TAB T=2 in order to paste the text.
When the macro goes to TAB 2 (starting part 2), suddenly stopped working doing a sort of infinite loading before process this
TAG POS=1 TYPE=A ATTR=TXT:IT
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:product-form ATTR=ID:Locales_0__Name CONTENT={{!VAR1}}
Why this happens? How can I resolve that?

How to click link with changing attributes using imacros?

I am creating a macro in which I want to click the anchor element.
The problem with this anchor element is that all the attributes changes randomly after every click.
Below is the anchor link
<a id="bLMa" class="**btn valign-wrapper** pulse **animated** lime accent-2 black-text">**Stаrt**</a>
Items marked between star always remain same. All other items changes continuously.
The location of the anchor changes randomly after every click.
I tried below steps
TAG XPATH="//*[#class="animated"]"
TAG POS=1 TYPE=A ATTR=Class:animated
TAG POS=1 TYPE=A ATTR=TXT:Start
TAG POS=1 TYPE=A ATTR=TXT:*Start*
I always get the same error as Element Not Found.
Please suggest.
You can try combining Attributes to identify the anchor you want to find as per http://wiki.imacros.net/TAG_parameters_explained#Multiple_ATTR_parameters
For your specific example something like
TAG POS=1 TYPE=A ATTR=class:*animated*&&TXT:*Start*
could work, looking for the class animated AND the text Start together in an anchor.

Unable to extract text from textbox on specific website using iMacros

I am trying to match coordinates with 9062 IATA codes that I have compiled in a CSV file. I have tried to use iMacros to input the IATA codes into this website: https://openflights.org/html/apsearch and to extract the coordinates that result.
When executing the macro I do not receive an error, but none of the values are extracted to my designated CSV (the CSV file is blank).
Here is the code:
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
SET !ERRORIGNORE YES
SET !DATASOURCE C:\REDACTED\Desktop\iatasolo.csv
SET !DATASOURCE_COLUMNS 1
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO=https://openflights.org/html/apsearch
SET !EXTRACT NULL
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:searchform ATTR=NAME:iatafilter CONTENT=NO
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:searchform ATTR=NAME:iata CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:searchform ATTR=*
TAG POS=6 TYPE=INPUT:BUTTON ATTR=*
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:searchform ATTR=NAME:y EXTRACT=TXT
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:searchform ATTR=NAME:x EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=C:\REDACTED\Desktop\macro\test2 FILE=coordinates.csv
Any help would be appreciated.
IATA CODE DATA: https://pastebin.com/4Ez4ids3
I ran your code with the sample data and the website and checked the issues.
List of Issues:
The input file was not getting detected. This was fixed by putting the path in quotes and using the "/" instead of "\" which is used in windows paths.
I have a wait of 2 seconds after the load button is clicked to give time for latitude and longitude to load.
Similarly output should have a different kind of format, this is what worked for me.
Please find below the working code:
VERSION BUILD=9030808 RECORDER=FX
SET !ERRORIGNORE YES
SET !DATASOURCE "C:/Users/Tester/Desktop/file_name.csv"
SET !DATASOURCE_COLUMNS 1
SET !TIMEOUT_STEP 30
SET !EXTRACTDIALOG NO
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO=https://openflights.org/html/apsearch
SET !EXTRACT NULL
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:searchform ATTR=NAME:iatafilter CONTENT=NO
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:searchform ATTR=NAME:iata CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:searchform ATTR=*
TAG POS=6 TYPE=INPUT:BUTTON ATTR=*
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:searchform ATTR=NAME:iata EXTRACT=TXT
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:searchform ATTR=NAME:y EXTRACT=TXT
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:searchform ATTR=NAME:x EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER="C:\\Users\\Tester\\Desktop" FILE=coordinates.csv

iMacros doesn't write caption (HTML) and tags in Tumblr post

I'm using Windows 7 and Firefox 44.0.2. I'm trying to schedule some posts on Tumblr using iMacros. When iMacros creates a post it adds an image and I want to write some code in html. Let's say:
<div>abcd</div>
but neither in caption nor in tags (If I want to write"test") anything appear.
This is my code
VERSION BUILD=8961227 RECORDER=FX
TAB T=1
TAG POS=1 TYPE=I ATTR=CLASS:icon_post_photo&&TXT:
TAG POS=1 TYPE=INPUT:FILE ATTR=NAME:photo CONTENT=E:\myDirectory\img.jpg
TAG POS=1 TYPE=BUTTON ATTR=DATA-JS-CLICKABLEPOSTSETTINGSCOG:&&CLASS:post-settings&&TXT:
TAG POS=1 TYPE=SELECT ATTR=ID:editorType CONTENT=%html
TAG POS=1 TYPE=DIV ATTR=CLASS:ace_content&&TXT:
TAG POS=1 TYPE=TEXTAREA ATTR=WRAP:off&&CLASS:ace_text-input&&SPELLCHECK:false&&ARIA-LABEL:HTML<SP>content&&TXT: CONTENT=<div>abcd</div>
TAG POS=3 TYPE=DIV ATTR=TXT:​#tags
TAG POS=3 TYPE=DIV ATTR=TXT:​test
TAG POS=5 TYPE=DIV ATTR=TXT:​test
what coould be the problem?
* UPDATE *
following the answer provided here by Shugar, I inserted that code and now I can make iMacros write text caption and alt tags but if I make iMacros change into html it won't write code in it. Here:
TAB T=1
TAG POS=1 TYPE=SPAN ATTR=TXT:Photo
TAG POS=1 TYPE=INPUT:FILE ATTR=NAME:photo CONTENT=E:\myDirectory\img.jpg
' here i ask iMacros to change open html instead of plain text caption
TAG POS=1 TYPE=BUTTON ATTR=DATA-JS-CLICKABLEPOSTSETTINGSCOG:&&CLASS:post-settings&&TXT:
TAG POS=1 TYPE=SELECT ATTR=ID:editorType CONTENT=%html
' wait to load the image
WAIT SECONDS=10
' caption
EVENT TYPE=CLICK SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV>DIV>DIV>P" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV>DIV>DIV" CHARS="<div>abdcdsa</div>"
WAIT SECONDS=0.5
' tag #1
EVENT TYPE=CLICK SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV>DIV>DIV" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV>DIV>DIV" CHARS="my tag1"
EVENTS TYPE=KEYPRESS SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV>DIV>DIV" CHARS=""
WAIT SECONDS=0.5
' tag #2
EVENT TYPE=CLICK SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV>DIV>DIV" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV>DIV>DIV" CHARS="my tag2"
EVENTS TYPE=KEYPRESS SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV>DIV>DIV" CHARS=""
WAIT SECONDS=0.5
' tags etc.
' ...
* UPDATE 2 *
after trying the code given by Shugar this is what I have but it stucks on line 11 and keep loading forever:
eTAB T=1
TAG POS=1 TYPE=SPAN ATTR=TXT:Photo
TAG POS=1 TYPE=INPUT:FILE ATTR=NAME:photo CONTENT=C:mydirectory\sample.jpg
' here i ask iMacros to change open html instead of plain text caption
TAG POS=1 TYPE=BUTTON ATTR=DATA-JS-CLICKABLEPOSTSETTINGSCOG:&&CLASS:post-settings&&TXT:
TAG POS=1 TYPE=SELECT ATTR=ID:editorType CONTENT=%html
' wait to load the image
WAIT SECONDS=10
' caption '
TAG POS=1 TYPE=BUTTON ATTR=DATA-JS-CLICKABLEPOSTSETTINGSCOG:&&CLASS:post-settings&&TXT:
TAG POS=1 TYPE=SELECT ATTR=ID:editorType CONTENT=%html
EVENT TYPE=CLICK SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(3)>DIV" BUTTON=0
SET !ERRORIGNORE YES
URL GOTO=javascript:alert();
SET !ERRORIGNORE NO
SET captionHtml "<div>caption text</div>"
EVENTS TYPE=KEYPRESS SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV>TEXTAREA" CHARS={{captionHtml}}e
Your macro must look like this:
TAB T=1
TAG POS=1 TYPE=SPAN ATTR=TXT:Photo
TAG POS=1 TYPE=INPUT:FILE ATTR=NAME:photo CONTENT=C:\mydirectory\sample.jpg
' wait to load the image '
WAIT SECONDS=10
' here i ask iMacros to change open html instead of plain text caption '
TAG POS=1 TYPE=BUTTON ATTR=DATA-JS-CLICKABLEPOSTSETTINGSCOG:&&CLASS:post-settings&&TXT:
TAG POS=1 TYPE=SELECT ATTR=ID:editorType CONTENT=%html
' caption '
EVENT TYPE=CLICK SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(3)>DIV" BUTTON=0
SET !ERRORIGNORE YES
URL GOTO=javascript:alert();
SET !ERRORIGNORE NO
SET captionHtml "<div>caption text</div>"
EVENTS TYPE=KEYPRESS SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV>TEXTAREA" CHARS={{captionHtml}}
At least it works perfectly for me :)

iMacros how to add custom text to extracted TXT

I have this code that checks for text on a page and then saves the text to a csv:
TAG POS=1 TYPE=DIV ATTR=TXT:* EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=C:\test FILE=test.csv
Is it possible to add my own text to the extracted TXT, I tried this:
TAG POS=1 TYPE=DIV ATTR=TXT:*+{{!CLIPBOARD}} EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=C:\test FILE=test.csv
So, this time I want it to save to the CSV as "textInDiv","clipboardValue"
Thanks.
TAG POS=1 TYPE=DIV ATTR=TXT:* EXTRACT=TXT
ADD !EXTRACT {{!CLIPBOARD}}
SAVEAS TYPE=EXTRACT FOLDER=C:\test FILE=test.csv
http://wiki.imacros.net/ADD
to save to the CSV as "textInDiv","clipboardValue", try this:
TAG POS=1 TYPE=DIV ATTR=TXT:* EXTRACT=TXT
SET !EXTRACT {{!EXTRACT}}[EXTRACT]{{!CLIPBOARD}}
SAVEAS TYPE=EXTRACT FOLDER=C:\test FILE=test.csv