Online .iim to .json converter

Hi Gang, is there a Online converter to convert .iim to .json? My file looks like the below and I’m just not understanding what needs to change. Thank you

TAG POS=1 TYPE=SELECT FORM=ID:form1 ATTR=ID:lbListOfReports CONTENT=%1058
WAIT SECONDS=2
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form1 ATTR=ID:txtParam1 CONTENT=96887

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form1 ATTR=ID:txtParam2 CONTENT=000
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form1 ATTR=ID:txtParam3 CONTENT=999

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form1 ATTR=ID:txtParam4 CONTENT=20231201
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form1 ATTR=ID:txtParam5 CONTENT=20231231

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form1 ATTR=ID:txtParam6 CONTENT=HCSA
TAG POS=1 TYPE=SELECT FORM=ID:form1 ATTR=ID:ddFormat CONTENT=%PDF
ONDOWNLOAD FOLDER=* FILE=096887_000_999_HCSA_TSA_Claims_Paid_by_Plan_Member_20231201_20231231.pdf WAIT=YES
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:form1 ATTR=ID:btnGenerateReport

Hi, have you seen this iMacros Alternative page? It contains plenty of information for migrating from iMacros to the open-source Ui.Vision.

Another option is to ask ChatGPT about Ui.Vision. I can’t test its result, but it looks reasonable. However, ChatGPT is wrong to say that Ui.Vision has no download command, of course it supports file downloads. It is just that the OnDownload command in Ui.Vision is optional. For normal downloads you do not need to add it. Only when you need some specific settings.

Anyway, here is that Chatgpt result:

I asked “convert this imacros file to ui.vision: …”

Answer:

— Start ChatGPT —
Converting an iMacros script to a UI.Vision RPA (formerly Kantu) macro involves translating the actions defined in the iMacros script into a JSON format that UI.Vision understands. Here’s how the provided iMacros script would be converted into a UI.Vision macro:

  1. Select Dropdown Option: The iMacros TAG command with TYPE=SELECT is used to select an option from a dropdown. UI.Vision uses select with xpath or id to target the element and value for the option to be selected.
  2. Wait Command: The iMacros WAIT command is directly translated to UI.Vision’s pause command.
  3. Input Text: The iMacros TAG command with TYPE=INPUT:TEXT is used for entering text into input fields. In UI.Vision, you would use type or sendKeys commands with appropriate selectors.
  4. File Download: The iMacros ONDOWNLOAD command specifies the action for a file download. UI.Vision handles downloads differently, typically through browser settings, as it doesn’t have a direct command to control downloads.
  5. Submit Form: The iMacros TAG command with TYPE=INPUT:SUBMIT is used to submit a form. In UI.Vision, this could be translated using click on the submit button.

Here’s an example of how the script might look after conversion to UI.Vision’s JSON format:

{
  "Name": "Converted_Macro",
  "CreationDate": "2024-02-29",
  "Commands": [
    {
      "Command": "select",
      "Target": "id=lbListOfReports",
      "Value": "label=1058"
    },
    {
      "Command": "pause",
      "Target": "2000",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "id=txtParam1",
      "Value": "96887"
    },
    {
      "Command": "type",
      "Target": "id=txtParam2",
      "Value": "000"
    },
    {
      "Command": "type",
      "Target": "id=txtParam3",
      "Value": "999"
    },
    {
      "Command": "type",
      "Target": "id=txtParam4",
      "Value": "20231201"
    },
    {
      "Command": "type",
      "Target": "id=txtParam5",
      "Value": "20231231"
    },
    {
      "Command": "type",
      "Target": "id=txtParam6",
      "Value": "HCSA"
    },
    {
      "Command": "select",
      "Target": "id=ddFormat",
      "Value": "label=PDF"
    },
    {
      "Command": "click",
      "Target": "id=btnGenerateReport",
      "Value": ""
    }
  ]
}

Note:

  • The label or value in the select command’s Value field may need adjustment based on the actual values used in your web application.
  • UI.Vision does not support handling file downloads directly in the macro. Ensure your browser is configured to automatically handle downloads from the site or use UI.Vision’s desktop automation features to interact with the download dialog if necessary.
  • Ensure the correct targeting method (id, xpath, etc.) is used based on your page’s structure. This example uses id for simplicity, assuming the elements have unique IDs.

— End ChatGPT —

Does this work for you?

Thanks, I’ll give it a go. How would I convert this command since I want to give it’s own file name?
ONDOWNLOAD FOLDER=* FILE=096887_000_999_HCSA_TSA_Claims_Paid_by_Plan_Member_20231201_20231231.pdf WAIT=YES

I asked for the command conversion specifically and it gave me this;
{
“Command”: “XRun”,
“Target”: “onDownload | folder=* | file=096887_000_999_HCSA_TSA_Claims_Paid_by_Plan_Member_20231201_20231231.pdf | wait=true”,
“Value”: “”
}

EDIT: Getting this error;
[error] in parsing HCSA 2023.json: Unexpected token ‘“’ at 60:3
“Command”: “XRun”,

Oh, that is some ChatGPT hallucination :grinning:

So the correct conversion of iMacros to Ui.Vision for OnDownload is:

iMacros:

ONDOWNLOAD FOLDER=* FILE=096887_000_999_HCSA...._20231231.pdf WAIT=YES

Ui.Vision:

OnDownload | 096887_000_999_HCSA...._20231231.pdf | true

The “true” parameter is optional, as Ui.Vision waits by default for the download to complete.