Jump to content

IE Question


Recommended Posts

Hi, I hope you can help me out. 

I am creating a script to open IE for a radio station then click a javascript button to open their popup player. Everything works fine, now how do I close the the individual windows when I am ready?

Here is my code so far that works for opening the windows.

Local $oIE = _IECreate("http://kykn.com")
Local $PopupWindow = _IENavigate($oIE,"javascript:openPlayer('KYKN');")

Thanks in advance.

Link to comment
Share on other sites

Here is the full code I tried. 

By individual windows, I mean the original IE window and the Popup window.

#include <Constants.au3>
#include <IE.au3>
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.10.2
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

Local $oIE = _IECreate("http://kykn.com")
Local $PopupWindow = _IENavigate($oIE,"javascript:openPlayer('KYKN');")
WinWait(30000)

_IEQuit($PopupWindow)

MsgBox($MB_SYSTEMMODAL,"test","Ok")
Edited by harvlake
Link to comment
Share on other sites

The javascript button leads to static address I believe, you could use _IECreat with that address.

#include <Constants.au3>
#include <IE.au3>
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.10.2
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

Local $oIE = _IECreate("http://radio.securenetsystems.net/v5/KYKN")
;~ _IENavigate($oIE,"javascript:openPlayer('KYKN');")
Sleep(30000)

_IEQuit($oIE)

MsgBox($MB_SYSTEMMODAL,"test","Ok")
Link to comment
Share on other sites

I am trying to select a specific box in a multiple choice item, currently i have everything right except clicking the right box for the 3rd (ans3) and 4th (ans4) questions, my code only fills out the first choice for each question...here is my code

#include <IE.au3>


Call ("Vote")

Func Vote ()
Global $oIE = _IECreate ("http://freeonlinesurveys.com/app/rendersurvey.asp?sid=zxus46gaw6qp49g452964&refer=")

Local $vote1 = _IEGetObjByName ($oIE, "ans1")
Local $vote2 = _IEGetObjByName ($oIE, "ans2")
Local $vote3 = _IEGetObjByName ($oIE, "ans3")
Local $vote4 = _IEGetObjByName ($oIE, "ans4")

_IEFormElementSetValue ($vote1, "1")
_IEFormElementSetValue ($vote2, "2")
_IEFormElementSetValue ($vote3, "3")
_IEFormElementSetValue ($vote4, "3")

_IEAction ($vote1, "click")
_IEAction ($vote2, "click")
_IEAction ($vote3, "click")
_IEAction ($vote4, "click")

EndFunc

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...