Sign in to follow this  
Followers 0
squadjot

Communicate between AutoIt and local webpage

9 posts in this topic

Hi,

I'm using $oIE = ObjCreate("Shell.Explorer.2"), to embed a local webapage from my HD into autoit

Can i somehow send data (strings) between autoit and the webpage, via vbs or javascript?

Thanks

Share this post


Link to post
Share on other sites



Hi, squadjot. First off, why would you want to create an embedded IE object in one language, and then use another to interact with it? It will be much easier to assist you if you post the code you have thus far, as well as a detailed explanation of how you would like to interact with the object (send some data (strings) just doesn't cut it). Help us help you :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi!

Oh, i thought my question was rather clear.

-

I do not have code.. i'm simply enquiring if certain functionality is available.. somehow..

-

Reason. Well i'm looking for a way to quickly develop small apps, but´with fairly advanced UI..n stuff.. , see i'm quite familiar working with HTML/JS and FLASH, it would be easy(ier) for me to

get some "flashyness" going on, rather than begin hacking at autoit (not that it does not seem capable..but i only have one life)

Ultimately autoit would mere function as some kind of bridge between html/js and flash and the system.

Edited by squadjot

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

and, i guess i'm asking for something like flash's "External.interface".. or "fscommand" ..like, a way to communicate between the wrapper and the content.

Edit: If autoit could embed HTA's it could work.. I'm not going with HTA's cause they lack dragdrop functionality, which i expect to use autoit for.

Edited by squadjot

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

With autoIt (or other) you can communicate with HTML/JS using different methods:

you can execute JS code e.g. $oIE.document.parentwindow.execScript("selBoxChangeColor()")

you can get/set values e.g.: $sMapGet = $oIE.document.all.memo.value

you can catch specific events, ..

Is that what you wanted to know.

You may have a look at the IE Management UDFs

Best regards, Reinhard

Edited by ReFran

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Oh thanks!..

Certain events? i guess your reffering to built in events.. onload etc.. so no custom events? - do you know if i'm able to trigger/call theese built in events manually from JS??.. (sorry lack of JS/DOM knowledge there)

Alternatively, and less preferably, i would have to let autoit check for values continously (get/set values as you mention)

EDIT: the IE Management UDF , is that a custom library?...or is it "native" autoit?..sorry i'm quite new to the autoit scene.. (yeah tried using the search =P)

Edited by squadjot

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Hi,

have a look in the helpfile on objEvent().

In html you may set up a (hidden) edit field with an onchange event.

The onchange event you can catch, the value from the edit may tell you what happened if you have filled with html/js.

There are some examples you will find here.

Best regards, Reinhard

Here a quick example:

func mapAddListener()

DIM $oMapEdit = $oIE.document.all.edit

objEvent($oMapEdit,"oMapEditEvent_")

endfunc

func oMapEditEvent_onpropertychange()

...

...

endfunc

Edited by ReFran

Share this post


Link to post
Share on other sites

Yeah! - cool trick.. thanks, this helped me alot!

Share this post


Link to post
Share on other sites

Above worked, and i can use that..

But, is there a way to directly call a AutoIT function from an embedded webpage? using Local $oIE = _IECreateEmbedded()

Thanks

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  
Followers 0