Jump to content

Message from webpage popup issue with a twist


paulk
 Share

Recommended Posts

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?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...