jeremym Posted May 11, 2007 Share Posted May 11, 2007 Hi team. Great job on all the new V3 features. I've been a V2 fan for a loong time. But I'm running into some snags.. with a really simple script. I've got the V2 and V3 (converted) versions below. Here's my main issue: -The script keeps pausing and unpausing it doesn't seem to do anything -I can't "see" where I am in the script anymore.. like in V2 with the little popup window showing me which line is being executed right now to see what the hangup is. -And, in other news.. what happened to /reveal mode? Thanks. V3 (converted): while (1) ; start : beginning of loop OR Func start () AutoItSetOption ( "WinDetectHiddenText", 1 ) WinWaitActive ( 'Name Not Found' ) Send ( '{TAB}{Enter}' ) WinWaitActive ( 'Select Name Type' ) Send ( '{DOWN}{DOWN}{DOWN}{SPACE}{ENTER}' ) MouseMove ( 308, 542 ) MouseClick( "left", 308, 542 ) wend ; start V2 (working): start: DetectHiddenText,on WinWaitActive,Name Not Found Send,{TAB}{Enter} WinWaitActive,Select Name Type Send,{DOWN}{DOWN}{DOWN}{SPACE}{ENTER} ;WinWaitActive,Moskowitz, inc. - QuickBooks Pro 2005 MouseMove,308,542 LeftClick,308,542 goto,start Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 11, 2007 Share Posted May 11, 2007 It is not good practice to set options in a loop, generally. And you seem to have skipped the window title parameter when watching for particular window text: AutoItSetOption("WinDetectHiddenText", 1) $WinTitle = "Your Window" While (1) ; start : beginning of loop OR Func start () WinWaitActive($WinTitle, 'Name Not Found') Send('{TAB}{Enter}') WinWaitActive($WinTitle, 'Select Name Type') Send('{DOWN}{DOWN}{DOWN}{SPACE}{ENTER}') MouseMove(308, 542) MouseClick("left", 308, 542) WEnd ; start Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
jeremym Posted May 11, 2007 Author Share Posted May 11, 2007 "Name Not Found" is the name of the window. I'm reading the help and it says that WinWaitActive("Name Not Found") ought to work. But it doesn't. And, what about the other question.. How can I see what line in the script we're currently executing? Thx. PS: So, at this point, I'm still "dead in the water" as the updated script doesn't yet work. :-( -- It is not good practice to set options in a loop, generally. And you seem to have skipped the window title parameter when watching for particular window text: AutoItSetOption("WinDetectHiddenText", 1) $WinTitle = "Your Window" While (1) ; start : beginning of loop OR Func start () WinWaitActive($WinTitle, 'Name Not Found') Send('{TAB}{Enter}') WinWaitActive($WinTitle, 'Select Name Type') Send('{DOWN}{DOWN}{DOWN}{SPACE}{ENTER}') MouseMove(308, 542) MouseClick("left", 308, 542) WEnd ; start Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 11, 2007 Share Posted May 11, 2007 (edited) "Name Not Found" is the name of the window.Oops. My bad. I thought you were searching for that as window text without a title. And, what about the other question.. How can I see what line in the script we're currently executing?Check out the option "TrayIconDebug" in the help file. PS: So, at this point, I'm still "dead in the water" as the updated script doesn't yet work. :-(Does that mean it didn't work like this?: Opt("WinDetectHiddenText", 1) Opt("TrayIconDebug", 1) ; Displays current line when you mouse over the icon While (1) ; start : beginning of loop OR Func start () WinWaitActive('Name Not Found') Send('{TAB}{Enter}') WinWaitActive('Select Name Type') Send('{DOWN}{DOWN}{DOWN}{SPACE}{ENTER}') MouseClick("left", 308, 542) WEnd ; start Edited May 11, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
jeremym Posted May 12, 2007 Author Share Posted May 12, 2007 Got the newest update from you. Thanks. But, still.. it's still not working. The tray icon shows that the script is pausing at all the WinWaitActive commands, and not doing any others -- at all... except looping back to the top. If I manually progress past the "Name Not Found" dialog box by clicking it, I see the script jump to, say, line 7 where it's waiting for the next window. In no cases are Mouse or Keyboard commands ever sent. PS: my system is Vista. I'm Running as Admin. Oops. My bad. I thought you were searching for that as window text without a title. Check out the option "TrayIconDebug" in the help file. Does that mean it didn't work like this?: Opt("WinDetectHiddenText", 1) Opt("TrayIconDebug", 1) ; Displays current line when you mouse over the icon While (1) ; start : beginning of loop OR Func start () WinWaitActive('Name Not Found') Send('{TAB}{Enter}') WinWaitActive('Select Name Type') Send('{DOWN}{DOWN}{DOWN}{SPACE}{ENTER}') MouseClick("left", 308, 542) WEnd ; start Link to comment Share on other sites More sharing options...
titewad Posted May 13, 2007 Share Posted May 13, 2007 Try adding this after the Winwaitactive: ControlFocus('Name Not Found') Link to comment Share on other sites More sharing options...
therks Posted May 13, 2007 Share Posted May 13, 2007 Is this a normal window? Like with the system buttons (maxi, mini, close), titlebar, etc? I've had some odd experiences with WinWaitActive with windows that aren't standard windows. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
jeremym Posted May 13, 2007 Author Share Posted May 13, 2007 It's Quickbooks 2006. Seems standard-ish. Has wierd shaing... but otherwise, seems standard.My AutoIT v2 script worked lilke a champ. But it doesn't work here either .. nowthat my host is a vista machine.Is this a normal window? Like with the system buttons (maxi, mini, close), titlebar, etc? I've had some odd experiences with WinWaitActive with windows that aren't standard windows. Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 13, 2007 Share Posted May 13, 2007 Welcome to Microsoft Vista! Where would like to beg permission to go today? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
1905russell Posted June 3, 2007 Share Posted June 3, 2007 It's Quickbooks 2006. Seems standard-ish. Has wierd shaing... but otherwise, seems standard.My AutoIT v2 script worked lilke a champ. But it doesn't work here either .. nowthat my host is a vista machine.Just saw this three week old thread. I dont know if you have resolved this yet but I have encountered many problems scripting with Quickbooks and have managed to sort most of them out. If this is a Vista problem then I cant help. What exactly are you trying to do? There might be an alternative approach? Where would Name Not Found window appear in QB, as everything is picked from a list box or linked to a report, register, account etc? What version of QB 2006 are you using pro, premier, manufacturing etc.? Link to comment Share on other sites More sharing options...
Zedna Posted June 3, 2007 Share Posted June 3, 2007 Try this: Opt("WinDetectHiddenText", 1) Opt("TrayIconDebug", 1) ; Displays current line when you mouse over the icon While 1 If WinExists('Name Not Found') Then WinActivate('Name Not Found') WinWaitActive('Name Not Found') Send('{TAB}{Enter}') WinWaitActive('Select Name Type') Send('{DOWN}{DOWN}{DOWN}{SPACE}{ENTER}') MouseClick("left", 308, 542) EndIf Sleep(100) WEnd Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
1905russell Posted June 3, 2007 Share Posted June 3, 2007 Try this: Opt("WinDetectHiddenText", 1) Opt("TrayIconDebug", 1) ; Displays current line when you mouse over the icon While 1 If WinExists('Name Not Found') Then WinActivate('Name Not Found') WinWaitActive('Name Not Found') Send('{TAB}{Enter}') WinWaitActive('Select Name Type') Send('{DOWN}{DOWN}{DOWN}{SPACE}{ENTER}') MouseClick("left", 308, 542) EndIf Sleep(100) WEnd Would love to try it if I knew where to operate this from? I can't find any window 'Name Not Found' or 'Select Name Type' in QB. I like - Sleep(xxx) - you need lots of these when working with QB. Link to comment Share on other sites More sharing options...
enaiman Posted June 4, 2007 Share Posted June 4, 2007 @jeremym Try to add: Opt("WinTitleMatchMode", 2) and shorten the desired name: "Name Not Found" to something shorter but characteristic like "Not Found" or "Found" or something else. This worked for me when everything else failed. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
1905russell Posted June 4, 2007 Share Posted June 4, 2007 (edited) @jeremym Try to add: Opt("WinTitleMatchMode", 2) and shorten the desired name: "Name Not Found" to something shorter but characteristic like "Not Found" or "Found" or something else. This worked for me when everything else failed.I am not having a problem with any window matching or any script. I'm having a problem finding anywhere in QuickBooks a screen with the words "Name Not Found" or "Not Found" or "Found" or "ound" or "und". I know how to detect a window with AI, thanks anyway. At this point this was a QB question not an AI question. I wanted and should have been able to test that script supposedly written for QB 2006 but I didn't know where in QB to run it - so I was asking. QB is designed for every name to either exist (in a listbox) or to be created on the fly (from the listbox). That "Name Not Found" message runs against the way it works and I suspect its referring to another AI Gui or more likely an external program or the real name has been changed (for whatever reason). Edited June 4, 2007 by 1905russell Link to comment Share on other sites More sharing options...
Zedna Posted June 4, 2007 Share Posted June 4, 2007 I am not having a problem with any window matching or any script. I'm having a problem finding anywhere in QuickBooks a screen with the words "Name Not Found" or "Not Found" or "Found" or "ound" or "und". I know how to detect a window with AI, thanks anyway. At this point this was a QB question not an AI question. I wanted to test that script supposedly written for QB 2006 but I suspect its referring to an AI Gui and not any QB module.I was answerring to jeremym's code. Look at first post... Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
1905russell Posted June 4, 2007 Share Posted June 4, 2007 I was answerring to jeremym's code. Look at first post...Sorry I thought it was at me.You are absolutely right with QuickbooksOpt("WinTitleMatchMode", 2)is your friend. Link to comment Share on other sites More sharing options...
enaiman Posted June 4, 2007 Share Posted June 4, 2007 @Zedna I was answerring to jeremym's code. Look at first post... @1905russell Opt("WinTitleMatchMode", 2) is your friend. This use to solve many WinWaitActive hangups SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) 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