Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
waiting for "Edit Customer" window in QuickBooks
#1
I've been able to program a number of macros to wait in the background and execute when a particular window is created in QuickBooks. I've used

act(wait(0 WC "Customer:Job Not Found")) with 100% success.

Now I want to create a macro that waits for the creation of the "Edit Customer", but I simply cannot get it to work.

It appears to be a child window, and when it is activated manually (in normal use, without a macro program), the field with the customer name is highlighted. I have tried numerous configurations of the Wait, and Act functions without success.

I have edited the properties to create a trigger, and using the Drag capability it creates the following trigger text

!a"My Company - QuickBooks Pro 2004" "MauiFrame" "Edit Customer" "MauiForm"

That does not work either - (however, I am not very certain I understand when and how "triggers" created through properties are activated.)

Do you have any suggestions? Thanks!

Craig
#2
int h=wait(0 WC "QuickBooks Pro")
wait 0 WV child("Edit Customer" "MauiForm" h)
#3
Fabulous! can I wait for Either Child - "New Customer" or "Edit Customer" - without responding to any other Child with "Customer" in it?
I know I might be able to use an "ifa" or two, but that could get complicated to keep monitoring for the other two while the unwanted window is open. can I put an "OR" in the "Child" function?
#4
Use regular expression:

wait 0 WV child("(New|Edit) Customer" "MauiForm" h 0x200)

If you want to know which child window it is:

int hc=wait(0 WV child("(New|Edit) Customer" "MauiForm" h 0x200))
if(childtest(hc "New Customer"))
out "it is New Customer"
else
out "it is Edit Customer"
#5
Thanks, Gintaras. I have implemented these wait and childtest functions with great results. They work on my computer consistently and flawlessly. Every time I open up a customer record in QuickBooks, my macro takes over with an alternate dialog and macro to collect and manipulate data. It works regardless of whether I Alt-Tab back and forth between several applications. I've been unable to make it malfunction.

The problem is that I've developed it for a client and in testing it on his computer, it works only sporadically. When launched, the tray icon turns red, and for a few times the macro works. Then for some reason, even though it is still red, the appearance of the QuickBooks window no longer activates the macro. I've been completely unable to duplicate the problem on my system, which is running the same XP operating system. I'm using 2.1.4

What are some possible issues, events or settings that can interfere with or disable (although still a red icon) the macro when waiting for a window? I tried unchecking the "Disable Windows Foreground-Lock feature" in runtime options, but it does not seem to make a difference.

Thanks, Craig
#6
I would like to see the macro.
#7
OK, thanks - I just sent the qml file
#8
I found what it is. The default on my computer was to display files in a filname.xxx format. My wait for window commands were triggered by the whole window name which frequently has the .xxx as part of the file name. On my client's computer, the .xxx is not displayed so the window waited forever. Thanks for offering to look. I've got it licked. I'll revise my wait commands to not include the .xxx.

Thanks

Craig
#9
Your really large and complex macro inspired me to add debug mode. It allows you to easily find the place where the macro stops. Somebody already requested it in the past. QM 2.1.6 is coming soon.
#10
I think that was me - I asked about a step mode a month or two ago. I've managed to use a combination of spe 1000 and strategic messages, but yes, a debug mode would be great. Meanwhile, I trust you saw that I solved my problem.

Thanks, Craig


Forum Jump:


Users browsing this thread: 1 Guest(s)