Greetings,
Thought I'd jump in here to clear up any confusion of the use "@_Dialog:"
The "@_Dialog:" is used when you need to send a particular keystroke or
keystrokes to a NUI dialog box. For example Key "@_Dialog:Y" would send a Y.
We need to do this because the NUI dialog box is a "semi separate" window so
think of it like telling the key were to go (to the dialog). However we do
see the dialog box's title just as we do any other NUI screen title meaning
it shows up at @1,1 just like as Allen suggested. 

I would rewrite the example you sent as follows where ScreenTitle is the
title of the NUI dialog box. 

Enter D("Value")
Do Until At(@7,14)
If At("[EMAIL PROTECTED],1")Then
   Key "@_DIALOG:{Y}"
   End If
Wait
Loop

Note that I've placed the If At within a Do-Loop. This is a very good habit
to get into - an If At is not like a Pause that "waits till it sees
something", it is a question - Am I at the specified screen condition? It is
possible for a dialog box to take a bit of time to pop-up - if you asked the
question during this "popping up" then it may not be there yet. By having
the if At in a loop, you ask the question more than once if needed. 

Also note the wait within the loop - this is just to slow the loop down a
bit, VBA/VB does not like being in a loop that is not doing much and an At
doesn't do much from a computing resource standpoint - I'm using the default
which is .5 sec. you can shorten this if it seems to needlessly slow the
script down.


Hope this sheds some light on the issue.
Regards,
Thom

Thom C. Blackwell
Product Manager
Boston Software Systems
866 653-5105

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Monroe, Allen K.
Sent: Monday, February 07, 2005 12:09 PM
To: [email protected]
Subject: RE: [Talk] Handling possible dialog boxes in MeditechNUI

Make sure you are pausing long enough before the dialog pops up for it to
recognize the text.

Off the top of my head I know the dialogs usually appear @1,1 so make sure
that is being specified at your IF AT statement as well.

Hope that helps!

-Allen

-----Original Message-----
From: Peter Charbonnier [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 07, 2005 9:06 AM
To: [email protected]
Subject: [Talk] Handling possible dialog boxes in MeditechNUI

Hello,

I'm writing a script which may or may not encounter a dialog box in
Meditech NUI.  What I want to happen is, if the dialog box appears,
for the script to key a "Y".  If the dialog box does not appear, then
it should key in the value from my spreadsheet as normal.  Here's what
I have:


My problem is that with this, it fails to recognize the IF statement
entirely.  The dialog box pops up and my script is waiting to pause at
7,14.

Does anyone know how to handle possible dialog boxes in Meditech NUI?

Thanks,
Peter Charbonnier
Overlake Hospital



Reply via email to