Jump to content
Sign in to follow this  
paulk

Message from webpage popup issue with a twist

Recommended Posts

paulk

I am having some problems getting my script to click ok on the "Message from webpage" popup.  Normally it is just a button that creates this and all is good, I can do that.  This page creates this popup as soon as text is entered.  I have tried both methods below.  The first one will enter the text and pause until I click ok on the popup (normal for a script in my experience) while the second one I cant seem to get the text to even enter into the field. 

Enters text correctly but waits for popup:

$i = 0
Do
    $oIE_4  = _IEAttach("Print Appointment Schedule - NetPracticePM", "embedded")
      $i = $i + 1
    Sleep(1000)
 Until IsObj($oIE_4) Or $i = 15
 If $i = 15 Then
    Exit
 Else
 EndIf
Local $oIE = $oIE_4
$oIFrame = _IEFrameGetObjByName($oIE, "contents")
$oForm = _IEFormGetObjByName ($oIFrame, "input")
$AptListName= _IEFormElementGetObjByName ($oForm,"ListName")
$AptListDesc= _IEFormElementGetObjByName ($oForm,"ListDesc")
$PTapptsave= _IEFormElementGetObjByName ($oForm,"save")
_IEFormElementSetValue ($AptListName, "surveyvitals")
_IEFormElementSetValue ($AptListDesc, "surveyvitals")
_IEAction($PTapptsave, "click")

Doesnt enter text but should detect popup:

$i = 0
Do
    $oIE_4  = _IEAttach("Print Appointment Schedule - NetPracticePM", "embedded")
      $i = $i + 1
    Sleep(1000)
 Until IsObj($oIE_4) Or $i = 15
 If $i = 15 Then
    Exit
 Else
 EndIf
Local $oIE = $oIE_4
$oIFrame = _IEFrameGetObjByName($oIE, "contents")
$oForm = _IEFormGetObjByName ($oIFrame, "input")
$AptListName= _IEFormElementGetObjByName ($oForm,"ListName")
$AptListDesc= _IEFormElementGetObjByName ($oForm,"ListDesc")
$PTapptsave= _IEFormElementGetObjByName ($oForm,"save")
_IEAction($AptListName, "focus")
Local $hIE = _IEPropertyGet($oIE, "Print Appointment Schedule - NetpracticePM")
;ControlSend("Print Appointment Schedule - NetpracticePM", "", "surveyvitals")
WinWait("Message from webpage", "List Name already exists. Overwrite?")
ControlClick("Message from webpage", "List Name already exists. Overwrite?", "[CLASS:Button; TEXT:OK; Instance:1;]")
_IEFormElementSetValue ($AptListDesc, "surveyvitals")
_IEAction($PTapptsave, "click")

I know its a stupid issue but I cant find where I went wrong. any ideas?

Share this post


Link to post
Share on other sites
paulk

i just am going to cheat and run a second compiled script to close the window with

Run("messagebox.exe","")

and

WinWait("Message from webpage", "List Name already exists. Overwrite?")
 ControlClick("Message from webpage", "List Name already exists. Overwrite?", "[CLASS:Button; TEXT:OK; Instance:1;]")

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×