TS79 Posted May 12, 2020 Posted May 12, 2020 I have an automated sync which pulls data from QuickBooks. However several dialog boxes will prevent the sync from occurring. Quickbooks has no quiet mode and is generally hostile towards any efforts to extract information from it (poor API - dropped features, slow to return results). I have this script: WinActivate("Bank Feeds In Use") sleep(1000) $iSendresult = ControlSend("Bank Feeds In Use","OK","[CLASS:MauiPushButton; INSTANCE:1]","{ENTER}",1) $iClickresult = ControlClick( "Bank Feeds In Use", "OK", "[CLASS:MauiPushButton; INSTANCE:1]") MsgBox(4096, "", "Sendresult: " & $iSendresult & " Clickresult: " & $iClickresult) Control returns 1 for both Send and Click yet the QB error remains. WinActivate works as expected. I have tried both x32 and x64 compilers. I have tried plain Send ("{ENTER}") and Send("{SPACE}") both of which work when manually interacting with the error message. For some reason I am unable to send anything to this dialog box. I have tried run as administrator as well. The OS is Server 2019, QuickBooks version 20 Enterprise Accountant. AutoITV3.3.14.5
Danp2 Posted May 12, 2020 Posted May 12, 2020 Not sure that this matters in your case, but I don't think you want / need the "OK" in the 2nd parameter. In the past, I had to resort to using WinActivate / Send when interacting with QB. Latest Webdriver UDF Release Webdriver Wiki FAQs
TS79 Posted May 12, 2020 Author Posted May 12, 2020 Thanks. I have tried without the OK. But OK is detected as the valid button text so I left it in. We are getting the '1' result so it thinks it is clicking/sending enter. It just has no effect on the window for some reason. Send did nothing either.
Earthshine Posted May 13, 2020 Posted May 13, 2020 FAQ31 UIAUTOMATION is probably what you want. Steep learning curve though My resources are limited. You must ask the right questions
TS79 Posted June 23, 2020 Author Posted June 23, 2020 Thanks for the tip. Had a little time today to look into it. Got this far but does not seem to do anything: ;~ *** Standard code Flexible*** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) Local $oP1=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=Company - Intuit QuickBooks Enterprise Solutions: Accountant 20.0(multi-user)(OpenSync);controltype:=UIA_WindowControlTypeId;class:=MauiFrame", $treescope_children) _UIA_Action($oP1,"setfocus") Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=Bank Feeds In Use;controltype:=UIA_WindowControlTypeId;class:=MauuiMessage", $treescope_children) _UIA_Action($oP0,"setfocus") _UIA_setVar("OK.mainwindow","title:=OK;classname:=MauiPushButton") _UIA_action("OK.mainwindow","setfocus") Looked at the tutorial docs. Attached is the full spy output. I removed the doublequotes in the standard code output to get it to run. I also tried the code cleanup. Need to play a bit more with it to find out how to make it click. ;~ *** Standard code Flexible*** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) Local $oP1 $oP1=_UIA_action("Title:=Company - Intuit QuickBooks Enterprise Solutions: Accountant 20.0(multi-user)(OpenSync);controltype:=UIA_WindowControlTypeId;class:=MauiFrame", "getobject") _UIA_Action($oP1,"move") Local $oP0 $oP0=_UIA_action("Title:=Bank Feeds In Use;controltype:=UIA_WindowControlTypeId;class:=MauuiMessage", "getobject") _UIA_Action($oP0,"move") _UIA_setVar("OK.mainwindow","title:=OK;classname:=MauiPushButton","move") _UIA_action("OK.mainwindow","setfocus","invoke") QBBankFeedsSpy.txt
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now