只有数组或字典类型才能被索引,求指教

zxh_501552 10天前 69

For Each value In 数据
    If value[0]<>""
        #icon("@res:kupuujo4-pses-52sa-heem-uqq6mff0b6me.png")
        Keyboard.InputText({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"IFRAME","src":"menu?path=material/poManage/entry"},{"tag":"INPUT","id":"querycondition1"}]},value[0],True,20,10000,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":500,"bSetForeground":True,"sSimulate":"message","bValidate":False,"bClickBeforeInput":False})
        #icon("@res:f98bffrk-4ar2-29df-jo25-tuavj5fvmv7e.png")
        Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"IFRAME","src":"menu?path=material/poManage/entry"},{"tag":"SPAN","parentid":"queryBtn","aaname":"查询"}]},"left","click",10000,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
        Try
            #icon("@res:huj23ht9-r87c-q6vq-2doe-4rgvkcs62b6m.png")
            Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"IFRAME","src":"menu?path=material/poManage/entry"},{"tag":"SPAN","parentid":"materialTable","aaname":"请点击选择规格和型号","tableCol":"8"}]},"left","click",10000,{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
        Catch 变量名
            Continue
        Else
            Delay(1000)
            #icon("@res:crca2ilj-bd3p-3pq8-tffi-s6aoufqruaes.png")
            Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"IFRAME","src":"menu?path=material/poManage/entry"},{"tag":"INPUT","type":"button","parentid":"detailTable"}]},"left","click",10000,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
            #icon("@res:08pcddq3-o6vb-7uhc-q4fi-dlmk2fhnavpj.png")
            Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"IFRAME","src":"menu?path=material/poManage/entry"},{"tag":"TABLE","id":"materialTable"},{"tag":"TD","type":"text","tableCol":"22"}]},"left","dbclick",10000,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
            #icon("@res:gb3tjf8t-74dq-7glg-of5b-8dqjg4d6vcrj.png")
            Keyboard.InputText({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"IFRAME","src":"menu?path=material/poManage/entry"},{"tag":"TABLE","id":"materialTable"},{"tag":"TD","type":"text","tableCol":"22"}]},value[1],True,20,10000,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":500,"bSetForeground":True,"sSimulate":"message","bValidate":False,"bClickBeforeInput":False})
            Keyboard.Press("Enter", "press", [],{"iDelayAfter":300,"iDelayBefore":200,"sSimulate":"simulate"})
            #icon("@res:cenb83bg-8kkp-hsoh-ic3g-9tmbcncggvi9.png")
            Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"IFRAME","src":"menu?path=material/poManage/entry"},{"tag":"BUTTON","id":"msg_confirm"}]},"left","click",10000,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
            #icon("@res:m9rlgme5-gjq8-iggq-pirv-2g3hjtss03gi.png")
            Mouse.Hover({"wnd":[{"app":"chrome","cls":"Chrome_WidgetWin_1","title":"主页 - Google Chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window","aaname":"主页"}],"ctrl":[{"role":"ROLE_SYSTEM_DOCUMENT","name":"主页"},{"role":"ROLE_SYSTEM_DOCUMENT","name":"采购需求录入"},{"role":"ROLE_SYSTEM_GRAPHIC","idx":2}]},10000,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
            #icon("@res:7fk28eka-ems8-hvb1-e5c6-3lue1amfn77t.png")
            内容 = UiElement.GetValue({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"IFRAME","src":"menu?path=material/poManage/entry"},{"tag":"DIV","css-selector":"body>div>table>tbody>tr>td>div"}]},{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200})
            #icon("@res:86csh4js-r2ou-ccp8-13f8-plfhe7nrl52j.png")
            UiElement.ScreenCapture(文件路径&"\\截图\\"&value[0]&".png",{"wnd":[{"app":"WeChat","cls":"SnapshotWnd","title":"MainWnd"}]},{"x":2788,"y":161,"width":613,"height":337},{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200})
            Dialog.Notify(value[0]&"截图已完毕", "图片", 1)
            

_只有数组或字典类型才能被索引,求指教

最新回复 (5)
  • zxh_501552 10天前
    2
    UiElement.ScreenCapture(文件路径&"\\截图\\"&value[0]&".png",{"wnd":[{"app":"WeChat","cls":"SnapshotWnd","title":"MainWnd"}]},{"x":2788,"y":161,"width":613,"height":337},{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200})
                Dialog.Notify(value[0]&"截图已完毕", "图片", 1)        命名文件夹是文件路径+第一列的时候就报错了。
  • lhui 9天前
    3
    可以在初始化的地方 Dim value[0]=""试试
  • zxh_501552 9天前
    4
    不对
  • 祖咏 9天前
    5
    数据这个数组有抓到东西嘛,没有的话,第51行开始就是错误的。而且你这是第一行报错,能把第一行的代码截图吗?
  • 祖咏 9天前
    6
    数据是一个二维数组吗,不是的话,value怎么加索引 
返回
发新帖