Docfxit Posted September 1, 2023 Share Posted September 1, 2023 (edited) I have this script that runs fine interactively. I can't get it to run compiled. Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) Opt("TrayIconDebug", 1) ;0-off ; Set so that tray displays current line number WinWait("Docfxit, Inc. - QuickBooks Desktop Pro 2021","General Ledger Last ") If Not WinActive("Docfxit, Inc. - QuickBooks Desktop Pro 2021","General Ledger Last ") Then WinActivate("Docfxit, Inc. - QuickBooks Desktop Pro 2021","General Ledger Last ") WinWaitActive("Docfxit, Inc. - QuickBooks Desktop Pro 2021","General Ledger Last ") Send("{ENTER}") WinWait("Docfxit, Inc. - QuickBooks Desktop Pro 2021","Enter Credit Card Ch") If Not WinActive("Docfxit, Inc. - QuickBooks Desktop Pro 2021","Enter Credit Card Ch") Then WinActivate("Docfxit, Inc. - QuickBooks Desktop Pro 2021","Enter Credit Card Ch") WinWaitActive("Docfxit, Inc. - QuickBooks Desktop Pro 2021","Enter Credit Card Ch") Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}") Sleep(100) Send("Loan") ; Loan payable officer Sleep(500) Send("{ENTER}") ;Sleep(500000) Send("{ALTDOWN}a{ALTUP}") Sleep(100) WinWait("Recording Transaction","Cancel") If Not WinActive("Recording Transaction","Cancel") Then WinActivate("Recording Transaction","Cancel") WinWaitActive("Recording Transaction","Cancel") Send("{ALTDOWN}y{ALTUP}") Running in Windows 10 AutoIt ver. 3.3.16.1 Edited September 1, 2023 by Docfxit Link to comment Share on other sites More sharing options...
Danp2 Posted September 1, 2023 Share Posted September 1, 2023 Which commands aren't working as desired? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Docfxit Posted September 1, 2023 Author Share Posted September 1, 2023 The first enter on line 10 for starters. Link to comment Share on other sites More sharing options...
Solution Nine Posted September 1, 2023 Solution Share Posted September 1, 2023 Maybe you are running Scite x64 but you compile x86 ? Docfxit 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danp2 Posted September 1, 2023 Share Posted September 1, 2023 This is what I've previously used to send text to QB -- Const $QBVersion = "QuickBooks Pro 2021" If WinActivate($QBVersion, "Write Checks - Due Client") Then send( "{TAB 3}" ) send( "Client Reimb:Reimb Owed" ) send( "{TAB 4}" ) send( "Checks" ) sleep(250) send( "{ENTER 2}" ) sleep( 1000 ) send( "{TAB}" ) If ControlGetFocus($QBVersion, "Write Checks - Due Client") <> 309 Then send( "{TAB}" ) EndIf ; If ControlCommand ($QBVersion, "Write Checks - Due Client", 305, "IsChecked") = 0 Then ; send( "{TAB}" ) ; EndIf Else Beep() EndIf Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Docfxit Posted September 1, 2023 Author Share Posted September 1, 2023 9 minutes ago, Nine said: Maybe you are running Scite x64 but you compile x86 ? I recompiled it to x64 and it solved the problem. In the past I was running Quickbooks 2020 and x86 worked. I did switch to 2021 this year and it seems to need x64. Thank you very much for catching that. Now I can get something done. Link to comment Share on other sites More sharing options...
Docfxit Posted September 1, 2023 Author Share Posted September 1, 2023 18 minutes ago, Danp2 said: This is what I've previously used to send text to QB -- Const $QBVersion = "QuickBooks Pro 2021" If WinActivate($QBVersion, "Write Checks - Due Client") Then send( "{TAB 3}" ) send( "Client Reimb:Reimb Owed" ) send( "{TAB 4}" ) send( "Checks" ) sleep(250) send( "{ENTER 2}" ) sleep( 1000 ) send( "{TAB}" ) If ControlGetFocus($QBVersion, "Write Checks - Due Client") <> 309 Then send( "{TAB}" ) EndIf ; If ControlCommand ($QBVersion, "Write Checks - Due Client", 305, "IsChecked") = 0 Then ; send( "{TAB}" ) ; EndIf Else Beep() EndIf I tried changing my code as a test because I like your approach. Const $QBVersion = "Docfxit, Inc. - QuickBooks Desktop Pro 2021" WinWait($QBVersion, "General Ledger Last Year") If Not WinActive($QBVersion, "General Ledger Last Year") Then WinActivate("Docfxit, Inc. - QuickBooks Desktop Pro 2021","General Ledger Last Year") WinWaitActive($QBVersion, "General Ledger Last Year") I couldn't get it to work. Link to comment Share on other sites More sharing options...
Danp2 Posted September 1, 2023 Share Posted September 1, 2023 Add some error checking so that you can determine which command is failing. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Docfxit Posted September 1, 2023 Author Share Posted September 1, 2023 I think it is looking better now. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) Opt("TrayIconDebug", 1) ;0-off ; Set so that tray displays current line number Const $QBVersion = "Docfxit, Inc. - QuickBooks Desktop Pro 2021" If WinActivate($QBVersion, "General Ledger Last Year") Then Send("{ENTER}") Sleep(100) ; MsgBox(0, "", "Pressed Enter: " ) ; Shows If WinActivate($QBVersion, "Enter Credit Card Ch") Then send( "{TAB 8}" ) Sleep(100) Send("Loan") ; Loan payable officer Sleep(500) Send("{ENTER}") Send("{ALTDOWN}a{ALTUP}") Sleep(100) EndIf If WinActivate("Recording Transaction","Cancel") Then Send("{ALTDOWN}y{ALTUP}") Sleep(200) Send("{UP}") EndIf Else Beep() EndIf I can't get the Sleep(200) before the Send("{up}") correct. Link to comment Share on other sites More sharing options...
Danp2 Posted September 1, 2023 Share Posted September 1, 2023 Have you tried using "!y" instead of "{ALTDOWN}y{ALTUP}"? What is the {UP} doing at the end? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Docfxit Posted September 1, 2023 Author Share Posted September 1, 2023 It's a timing issue. The last screen stays up a long time. If there is a way to wait for the screen to go away that would fix it. The {UP} moves the cursor to the next transaction. Link to comment Share on other sites More sharing options...
Nine Posted September 1, 2023 Share Posted September 1, 2023 9 minutes ago, Docfxit said: If there is a way to wait for the screen to go away that would fix it. While WinExists("your title here") Sleep(100) WEnd “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Docfxit Posted September 1, 2023 Author Share Posted September 1, 2023 I don't know if this is what you had in mind: If WinActivate("Recording Transaction","Cancel") Then Send("!y") EndIf While WinExists("Recording Transaction","Cancel") Sleep(100) WEnd Send("{UP}") It isn't moving the cursor up one transaction. Link to comment Share on other sites More sharing options...
Nine Posted September 1, 2023 Share Posted September 1, 2023 Yes it was. You may need to give focus the the right window after this one closes or wait a little longer. You need to experiment... Docfxit 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Docfxit Posted September 1, 2023 Author Share Posted September 1, 2023 (edited) Yea!!! This is working: If WinActivate("Recording Transaction", "Cancel") Then Send("!y") EndIf While WinExists("Recording Transaction", "Cancel") Sleep(100) WEnd If WinActivate($QBVersion, "General Ledger Last Year") Then Send("{UP}") EndIf You guys are great. It's so nice getting your help to resolve issues. Thanks a bunch... Edited September 1, 2023 by Docfxit Danp2 1 Link to comment Share on other sites More sharing options...
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