Help to convert imacros macro to UI.Vision code

Hi, just yesterday imacros has stopped working for me on an old version of firefox. I used that to fill in a form as seen here - WhoFish - Local Events and Activities

Would you be able to help me please to successfully use Ui Vision, heres my macro I needed to be converted

VERSION BUILD=8970419 RECORDER=FX

SET !ERRORIGNORE YES

SET !TIMEOUT_PAGE 60

TAB T=1

SET !DATASOURCE D:\Files\Documents\CY\Upload.csv

'SET !DATASOURCE_COLUMNS 16

'Start at line 2 to skip the header in the file

SET !LOOP 2

'Increase the current position in the file with each loop

SET !DATASOURCE_LINE {{!LOOP}}

'Fill web form

URL GOTO={{!COL16}}

WAIT SECONDS=1.0

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:txtArticleTitle CONTENT={{!COL1}}

TAG POS=1 TYPE=TEXTAREA FORM=ID:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:txtEPSummary CONTENT={{!COL2}}

TAG POS=1 TYPE=TEXTAREA FORM=ID:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:txtArticle CONTENT={{!COL3}}

TAG POS=1 TYPE=SELECT FORM=ID:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:ddlCityList CONTENT=${{!COL5}}

TAG POS=1 TYPE=TEXTAREA FORM=ID:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:txtAddress CONTENT={{!COL6}}

TAG POS=1 TYPE=TEXTAREA FORM=NAME:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:txtWebUrl CONTENT={{!COL7}}

TAG POS=1 TYPE=TEXTAREA FORM=ID:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:txtContactInfo CONTENT={{!COL8}}

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:txtCost CONTENT={{!COL9}}

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:txtEventSDate CONTENT={{!COL10}}

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:txtTiming CONTENT={{!COL11}}

TAG POS=1 TYPE=SELECT FORM=ID:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:ddlCategoryList CONTENT=${{!COL12}}

TAG POS=1 TYPE=SELECT FORM=ID:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:ddlAudienceList CONTENT=$*{{!COL13}}*

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:Form ATTR=NAME:_ctl0:_ctl3:_ctl0:_ctl0:txtContactEmail CONTENT={{!COL14}}

TAG POS=1 TYPE=INPUT:FILE FORM=ID:Form ATTR=ID:_ctl0__ctl3__ctl0__ctl0_thePhotoControl CONTENT={{!COL15}}

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:Form ATTR=ID:_ctl0__ctl3__ctl0__ctl0_txtEventEDate CONTENT={{!COL17}}

TAG POS=1 TYPE=INPUT:RADIO FORM=ID:Form ATTR=ID:{{!COL18}}

TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:Form ATTR=ID:_ctl0__ctl3__ctl0__ctl0_cbListDays1_0 CONTENT={{!COL19}}

TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:Form ATTR=ID:_ctl0__ctl3__ctl0__ctl0_cbListDays1_1 CONTENT={{!COL20}}

TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:Form ATTR=ID:_ctl0__ctl3__ctl0__ctl0_cbListDays1_2 CONTENT={{!COL21}}

TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:Form ATTR=ID:_ctl0__ctl3__ctl0__ctl0_cbListDays1_3 CONTENT={{!COL22}}

TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:Form ATTR=ID:_ctl0__ctl3__ctl0__ctl0_cbListDays1_4 CONTENT={{!COL23}}

TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:Form ATTR=ID:_ctl0__ctl3__ctl0__ctl0_cbListDays1_5 CONTENT={{!COL24}}

TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:Form ATTR=ID:_ctl0__ctl3__ctl0__ctl0_cbListDays1_6 CONTENT={{!COL25}}

TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:Form ATTR=ID:_ctl0__ctl3__ctl0__ctl0_btnPreview

WAIT SECONDS=1.0

TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:Form ATTR=ID:_ctl0__ctl3__ctl0__ctl0_btnPreviewSave

WAIT SECONDS=1.0

TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:Form ATTR=ID:_ctl0__ctl3__ctl0__ctl0_btnFinished

WAIT SECONDS=1.0

URL GOTO=http://www.whofish.org/Default.aspx?action=whatsnew&tabid=51&modid=385&rCode=1

TAG POS=2 TYPE=TD ATTR=BGCOLOR:#fffacd EXTRACT=TXT

TAG POS=4 TYPE=TD ATTR=BGCOLOR:#fffacd EXTRACT=TXT

TAG POS=6 TYPE=TD ATTR=BGCOLOR:#fffacd EXTRACT=TXT

TAG POS=1 TYPE=A ATTR=TXT:Click<SP>here<SP>to<SP>View EXTRACT=HREF

TAG POS=1 TYPE=TD ATTR=TXT:1 EXTRACT=TXT

SET !VAR1 {{!EXTRACT}}

SET !EXTRACT NULL

SET !EXTRACT {{!COL1}}

ADD !EXTRACT {{!VAR1}}

SAVEAS TYPE=EXTRACT FOLDER=D:\Files\Documents\CY FILE=TRACKER.csv

Thank you so much in advance!

1 Like

It looks like iMacros is getting turned off by Chrome these days.

But no worries, there are many former iMacros users in this RPA forum, so we can help.

Some questions first:

Hi! Thank you so much for your reply.

I creared the imacros macro just out of trial and error and it worked perfectly :slight_smile:
Yep, I’ve seen it but I’m very confused, but I’ve made it work, I will paste it here, can you let me know if its okay? The part where it will open up a webpage at the later part to extract some data, most of the time fails.

{
“Name”: “Upload Events-No Days”,
“CreationDate”: “2025-3-25”,
“Commands”: [
{
“Command”: “csvRead”,
“Target”: “Book3.csv”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “open”,
“Target”: “${!COL16}”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “pause”,
“Target”: “1000”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:txtArticleTitle”,
“Value”: “${!COL1}”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:txtEPSummary”,
“Value”: “${!COL2}”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:txtArticle”,
“Value”: “${!COL3}”,
“Description”: “”
},
{
“Command”: “select”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:ddlCityList”,
“Value”: “label=${!COL5}”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:txtAddress”,
“Value”: “${!COL6}”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:txtWebUrl”,
“Value”: “${!COL7}”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:txtContactInfo”,
“Value”: “${!COL8}”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:txtCost”,
“Value”: “${!COL9}”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:txtEventSDate”,
“Value”: “${!COL10}”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:txtTiming”,
“Value”: “${!COL11}”,
“Description”: “”
},
{
“Command”: “select”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:ddlCategoryList”,
“Value”: “label=${!COL12}”,
“Description”: “”
},
{
“Command”: “select”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:ddlAudienceList”,
“Value”: “label=${!COL13}”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “name=_ctl0:_ctl3:_ctl0:_ctl0:txtContactEmail”,
“Value”: “${!COL14}”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “id=_ctl0__ctl3__ctl0__ctl0_thePhotoControl”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “id=_ctl0__ctl3__ctl0__ctl0_thePhotoControl”,
“Value”: “${!COL15}”,
“Description”: “”
},
{
“Command”: “type”,
“Target”: “id=_ctl0__ctl3__ctl0__ctl0_txtEventEDate”,
“Value”: “${!COL17}”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “id=${!COL18}”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “clickAndWait”,
“Target”: “id=_ctl0__ctl3__ctl0__ctl0_btnPreview”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “pause”,
“Target”: “1000”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “clickAndWait”,
“Target”: “id=_ctl0__ctl3__ctl0__ctl0_btnPreviewSave”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “pause”,
“Target”: “1000”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “clickAndWait”,
“Target”: “id=_ctl0__ctl3__ctl0__ctl0_btnFinished”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “pause”,
“Target”: “1000”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “open”,
“Target”: “Admin”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “waitForPageToLoad”,
“Target”: “Admin”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “pause”,
“Target”: “5000”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “storeText”,
“Target”: “xpath=//[@id="_ctl0__ctl3__ctl0__ctl0_lblWNE_Events"]/table/tbody/tr/td[2]",
“Value”: “!csvLine”,
“Description”: “”
},
{
“Command”: “storeText”,
“Target”: "xpath=//
[@id="_ctl0__ctl3__ctl0__ctl0_lblWNE_Events"]/table/tbody/tr[2]/td[2]”,
“Value”: “!csvLine”,
“Description”: “”
},
{
“Command”: “storeText”,
“Target”: “xpath=//[@id="_ctl0__ctl3__ctl0__ctl0_lblWNE_Events"]/table/tbody/tr[3]/td[2]",
“Value”: “!csvLine”,
“Description”: “”
},
{
“Command”: “storeAttribute”,
“Target”: “xpath=//a[contains(text(),‘Click here to View’)]@href”,
“Value”: “!csvLine”,
“Description”: “”
},
{
“Command”: “storeText”,
“Target”: "xpath=//
[@id="_ctl0__ctl3__ctl0__ctl0_lblWNE_Events"]/table/tbody/tr[5]/td[2]”,
“Value”: “!csvLine”,
“Description”: “”
},
{
“Command”: “csvSave”,
“Target”: “tracker.csv”,
“Value”: “”,
“Description”: “”
}
]
}

you need custom xpaths

and this part worked in imacros? If so, can you post the imacros lines reponsible for this? Maybe I can “translate” them to Ui.vision code.

Hey, I got this to work :slight_smile:

{
  "Name": "Upload Events-Final",
  "CreationDate": "2025-4-6",
  "Commands": [
    {
      "Command": "csvRead",
      "Target": "Book3.csv",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "open",
      "Target": "${!COL16}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "1000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "${!COL1}",
      "Value": "!csvLine",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:txtArticleTitle",
      "Value": "${!COL1}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:txtEPSummary",
      "Value": "${!COL2}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:txtArticle",
      "Value": "${!COL3}",
      "Description": ""
    },
    {
      "Command": "select",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:ddlCityList",
      "Value": "label=${!COL5}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:txtAddress",
      "Value": "${!COL6}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:txtWebUrl",
      "Value": "${!COL7}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:txtContactInfo",
      "Value": "${!COL8}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:txtCost",
      "Value": "${!COL9}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:txtEventSDate",
      "Value": "${!COL10}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:txtTiming",
      "Value": "${!COL11}",
      "Description": ""
    },
    {
      "Command": "select",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:ddlCategoryList",
      "Value": "label=${!COL12}",
      "Description": ""
    },
    {
      "Command": "select",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:ddlAudienceList",
      "Value": "label=${!COL13}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "name=_ctl0:_ctl3:_ctl0:_ctl0:txtContactEmail",
      "Value": "${!COL14}",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "id=_ctl0__ctl3__ctl0__ctl0_thePhotoControl",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "id=_ctl0__ctl3__ctl0__ctl0_thePhotoControl",
      "Value": "${!COL15}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "id=_ctl0__ctl3__ctl0__ctl0_txtEventEDate",
      "Value": "${!COL17}",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "id=${!COL18}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "id=_ctl0__ctl3__ctl0__ctl0_btnPreview",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "waitForElementVisible",
      "Target": "id=_ctl0__ctl3__ctl0__ctl0_btnPreviewSave",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "3000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "id=_ctl0__ctl3__ctl0__ctl0_btnPreviewSave",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "waitForElementVisible",
      "Target": "id=_ctl0__ctl3__ctl0__ctl0_btnFinished",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "3000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "id=_ctl0__ctl3__ctl0__ctl0_btnFinished",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "2000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "open",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"_ctl0__ctl3__ctl0__ctl0_lblWNE_Events\"]/table/tbody/tr/td[2]",
      "Value": "!csvLine",
      "Description": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"_ctl0__ctl3__ctl0__ctl0_lblWNE_Events\"]/table/tbody/tr[2]/td[2]",
      "Value": "!csvLine",
      "Description": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"_ctl0__ctl3__ctl0__ctl0_lblWNE_Events\"]/table/tbody/tr[3]/td[2]",
      "Value": "!csvLine",
      "Description": ""
    },
    {
      "Command": "storeAttribute",
      "Target": "xpath=//a[contains(text(),'Click here to View')]@href",
      "Value": "!csvLine",
      "Description": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"_ctl0__ctl3__ctl0__ctl0_lblWNE_Events\"]/table/tbody/tr[5]/td[2]",
      "Value": "!csvLine",
      "Description": ""
    },
    {
      "Command": "csvSave",
      "Target": "tracker.csv",
      "Value": "",
      "Description": ""
    }
  ]
}
1 Like