添加ocr识别文字

功能建议 · 507 次浏览
shenbourne 创建于 2023-03-25 13:31

例如这样:(由于不能上传.qka文件,我只能以文字形式放在下面)

{
  "LimitSingleInstance": true,
  "SummaryExpression": "",
  "SubPrograms": [],
  "Variables": [
    {
      "Key": "context",
      "Type": 0,
      "Desc": "默认的文本变量",
      "DefaultValue": "",
      "SaveState": false,
      "IsInput": false,
      "IsOutput": false,
      "ParamName": null,
      "InputParamInfo": null,
      "OutputParamInfo": null,
      "TableDef": null,
      "CustomType": null
    },
    {
      "Key": "img",
      "Type": 3,
      "Desc": "默认的图片变量",
      "DefaultValue": "",
      "SaveState": false,
      "IsInput": false,
      "IsOutput": false,
      "ParamName": null,
      "InputParamInfo": null,
      "OutputParamInfo": null,
      "TableDef": null,
      "CustomType": null
    },
    {
      "Key": "isSuccess",
      "Type": 2,
      "Desc": "",
      "DefaultValue": "",
      "SaveState": false,
      "IsInput": false,
      "IsOutput": false,
      "ParamName": "",
      "InputParamInfo": null,
      "OutputParamInfo": null,
      "TableDef": null,
      "CustomType": null
    }
  ],
  "Steps": [
    {
      "StepRunnerKey": "sys:getSelectedText",
      "InputParams": {
        "format": {
          "VarKey": null,
          "Value": "UnicodeText"
        },
        "waitMs": {
          "VarKey": null,
          "Value": "250"
        },
        "repeat": {
          "VarKey": null,
          "Value": "0"
        },
        "trim": {
          "VarKey": null,
          "Value": "0"
        },
        "useActionParam": {
          "VarKey": null,
          "Value": "0"
        },
        "stopIfFail": {
          "VarKey": null,
          "Value": "0"
        }
      },
      "OutputParams": {
        "isSuccess": "isSuccess",
        "output": "context",
        "outputEncoded": null,
        "url": null
      },
      "IfSteps": null,
      "ElseSteps": null,
      "Note": "",
      "Disabled": false,
      "Collapsed": false,
      "DelayMs": 0
    },
    {
      "StepRunnerKey": "sys:simpleIf",
      "InputParams": {
        "condition": {
          "VarKey": null,
          "Value": "$= {isSuccess} == false"
        }
      },
      "OutputParams": {},
      "IfSteps": [
        {
          "StepRunnerKey": "sys:screenCapture",
          "InputParams": {
            "type": {
              "VarKey": null,
              "Value": "select"
            },
            "delay": {
              "VarKey": null,
              "Value": "0"
            },
            "toClip": {
              "VarKey": null,
              "Value": "0"
            },
            "stopIfFail": {
              "VarKey": null,
              "Value": "1"
            }
          },
          "OutputParams": {
            "img": "img",
            "rect": null,
            "isSuccess": null
          },
          "IfSteps": null,
          "ElseSteps": null,
          "Note": "",
          "Disabled": false,
          "Collapsed": false,
          "DelayMs": 0
        },
        {
          "StepRunnerKey": "sys:basic-ocr",
          "InputParams": {
            "operation": {
              "VarKey": null,
              "Value": "baidu-quicker"
            },
            "imgVar": {
              "VarKey": "img",
              "Value": null
            },
            "punctuationType": {
              "VarKey": null,
              "Value": "no"
            },
            "mergeChapter": {
              "VarKey": null,
              "Value": "no"
            },
            "stopIfFail": {
              "VarKey": null,
              "Value": "1"
            }
          },
          "OutputParams": {
            "isSuccess": null,
            "textList": null,
            "content": "context",
            "rawData": null,
            "rawObject": null
          },
          "IfSteps": null,
          "ElseSteps": null,
          "Note": "",
          "Disabled": false,
          "Collapsed": false,
          "DelayMs": 0
        }
      ],
      "ElseSteps": null,
      "Note": "",
      "Disabled": false,
      "Collapsed": false,
      "DelayMs": 0
    },
    {
      "StepRunnerKey": "sys:assign",
      "InputParams": {
        "input": {
          "VarKey": null,
          "Value": "$= Uri.EscapeDataString({context})"
        },
        "stopIfFail": {
          "VarKey": null,
          "Value": "1"
        }
      },
      "OutputParams": {
        "isSuccess": null,
        "output": "context"
      },
      "IfSteps": null,
      "ElseSteps": null,
      "Note": "",
      "Disabled": false,
      "Collapsed": false,
      "DelayMs": 0
    },
    {
      "StepRunnerKey": "sys:formatString",
      "InputParams": {
        "formatString": {
          "VarKey": null,
          "Value": "https://fanyi.baidu.com/#auto/zh/{0}"
        },
        "p0": {
          "VarKey": "context",
          "Value": null
        },
        "p1": {
          "VarKey": null,
          "Value": ""
        },
        "p2": {
          "VarKey": null,
          "Value": ""
        },
        "p3": {
          "VarKey": null,
          "Value": ""
        },
        "p4": {
          "VarKey": null,
          "Value": ""
        }
      },
      "OutputParams": {
        "output": "context"
      },
      "IfSteps": null,
      "ElseSteps": null,
      "Note": "",
      "Disabled": false,
      "Collapsed": false,
      "DelayMs": 0
    },
    {
      "StepRunnerKey": "sys:openUrl",
      "InputParams": {
        "url": {
          "VarKey": "context",
          "Value": null
        },
        "browser": {
          "VarKey": null,
          "Value": "default"
        }
      },
      "OutputParams": {},
      "IfSteps": null,
      "ElseSteps": null,
      "Note": null,
      "Disabled": false,
      "Collapsed": false,
      "DelayMs": 0
    }
  ]
}

回复内容
暂无回复
回复主贴