Jump to content
Sign in to follow this  

Notify AutoIt that JScript function in embedded web page returned

Recommended Posts


hey friends,

I have a web page loaded to an embedded browser in a GUI, I  was thinking if there is a way that AutoIt can get notified when a jscript function returns:

Simple code for fast test:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$oIE = ObjCreate("Shell.Explorer.2")
GUICreate("JS + AU3", 500, 200)
GUICtrlCreateObj($oIE, 10, 40, 400, 100)

$oIE.navigate(@ScriptDir & "\jsau3.html")

While 1
    $msg = GUIGetMsg()

        Case $msg = $GUI_EVENT_CLOSE


Func Command()
    MsgBox(0,"","Hi From AU3")

Simple HTML file with jScript functions: (jsau3.html)

<html xmlns="http://www.w3.org/1999/xhtml">

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<script>function Browser() {alert("Hi From JS")};</script>
<script>function AutoIt() {//Send Command To AutoIt};</script>


<form method="post">
    <input name="Button1" type="button" value="Send JS MsgBox To Browser" onclick="Browser()" />
    <input name="Button2" type="button" value="Send Command To AutoIt" onclick="AutoIt()" /></form>


Button2 should notify AutoIt to run Function "Command()" if this is possible somehow.

thank you.

Edited by EKY32

[font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font]

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.