0

是否有任何工具可以自动从 MYOB (AccountRight Plus) 导出所有报告?我已经尝试过 AutoIt 和 Sikuli,但似乎鼠标点击(和键盘发送/键入命令)以某种方式被忽略了。可能吗?下面是我正在使用的 AutoIt 脚本:

    #include <ImageSearch.au3>
    #include <WinAPI.au3>
    #include <Constants.au3>
    $x1=0
    $y1=0
    WinActivate("AccountRight Plus")
    Sleep(200)
    $result = _ImageSearch("Accounts.bmp",1,$x1,$y1,0)
    if $result=1 Then
        MouseMove($x1,$y1,3)
        MouseClick("left")
        Sleep(1000)
        MouseClick("left")
        $aMouse = MouseGetPos() ; Remembers current mouse position
        ConsoleWrite("Mouse Clicked at " & $aMouse[0] & "," & $aMouse[1] & @LF)
        Sleep(500)
        ;Try with Handle
        Local $handle = WinGetHandle("AccountRight Plus")
        If @error Then
            MsgBox(4096, "Error", "Could not find the correct window")
        Else
            ConsoleWrite("$handle = " & $handle & @LF)
            ControlSend($handle, "", "", "^i")
        EndIf
        Sleep(1000)
        ;try winAPI
        ;MsgBox(0, "Info", "Moving mouse")
        _WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, 653, 454)
        _WinAPI_Mouse_Event($MOUSEEVENTF_LEFTDOWN)
        Sleep(500)
        _WinAPI_Mouse_Event($MOUSEEVENTF_LEFTUP)
        ; try Control Click
        $controResult=ControlClick("ABC - Command Centre",20806,"left",2,62,106)
        ConsoleWrite("controlResult = " & $controResult & @LF)
        Sleep(1000)
        ; try ControSend to inner frame
        $controResult=ControlSend("AccountRight Plus","ABC- Command Centre",20806,"{TAB}")
        ConsoleWrite("controlResult = " & $controResult & @LF)
        Sleep(1000)
        ; try ControSend to outer frame
        $controResult=ControlSend("AccountRight Plus","","","{ALT}")
        ConsoleWrite("controlResult = " & $controResult & @LF)
        Sleep(1000)
        ; try with CLASS
        $controResult=ControlSend("AccountRight Plus","","[CLASS:MDIClient; INSTANCE:1]","{TAB}")
        ConsoleWrite("controlResult = " & $controResult & @LF)
        Sleep(1000)
        ; try send
        Send("{TAB}")
        Sleep(1000)
        Send("{TAB}")
        Sleep(1000)
        ;try MenuSelect
        WinMenuSelectItem("AccountRight Plus", "", "&File")
        Sleep(1000)
        MsgBox(0,"Found","picture found.")
            EndIf
4

1 回答 1

0

努西,,

您是否尝试过直接在您的应用程序中使用扫描码?

这是一个例子。它在当前位置单击鼠标,然后发送 {Tab}。您需要根据需要更改此设置。您可以先使用“MouseMove,150,250”将鼠标移动到正确的位置,这些是 X、Y 位置。

F8:: ; Press F8 to start macro
Send, {vk01} ; Click left mouse button
;Send, {scYYY} ; 
Send, {vk09sc00F} ; Send the Vk and SC codes for the {Tab} key.
Return

让我知道这个是否奏效

于 2013-01-25T10:01:00.503 回答