{
  "Name": "CafeF-BCTC-PDF-Vietstock-report-count",
  "CreationDate": "2025-8-14",
  "Commands": [
    {
      "Command": "echo",
      "Target": "--- Begin count report volume ---",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "nodisplay",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "true",
      "Value": "!ErrorIgnore",
      "Description": ""
    },
    {
      "Command": "open",
      "Target": "https://finance.vietstock.vn/${!COL1}/tai-tai-lieu.htm?doctype=1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "5000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // true",
      "Value": "!statusOK",
      "Description": ""
    },
    {
      "Command": "times",
      "Target": "5",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "storeAttribute // xpath=//*[@id=\"document-content\"]/div/div[2]/div[2]/p[2]/a@href",
      "Value": "filename1",
      "Description": "full link filename"
    },
    {
      "Command": "storeAttribute",
      "Target": "xpath=//*[@id=\"document-content\"]/div/div[2]/div[2]/p[${!times}]/a@href",
      "Value": "filename1",
      "Description": "full link filename"
    },
    {
      "Command": "echo",
      "Target": "full link is ${filename1}",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "executeScript",
      "Target": "var myRe = /[^\\_]+(?=\\_\\d)/;\nvar myArray = myRe.exec(${filename1}); return myArray",
      "Value": "rpterm1",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "Vietstock report quarter is ${rpterm1}",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "if",
      "Target": "${rpterm1}.lastIndexOf(${!COL5}) >=0",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "${!COL1}",
      "Value": "!csvLine",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "${!COL2}",
      "Value": "!csvLine",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "${!COL5}",
      "Value": "!csvLine",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "${!times}",
      "Value": "!csvLine",
      "Description": ""
    },
    {
      "Command": "csvSave",
      "Target": "${!COL1}-${!COL2}-${!COL5}-Vietstock-BCTC-count.csv",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "csvRead // ${!COL1}-${!COL2}-${!COL5}-BCTC.csv",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "${!COL1} has ${!CsvReadMaxRow} report(s) ${!COL5} year ${!COL2}",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "executeScript // var myVar=max(time1); return Number (myVar);",
      "Value": "time2",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "--- Finish count report volume ---",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "csvRead",
      "Target": "ticker.csv",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "if",
      "Target": "${rpterm1}.lastIndexOf(${!COL5}) >=0",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "run",
      "Target": "CafeF-BCTC-PDF-Vietstock-filename",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    }
  ]
}