| View previous topic :: View next topic |
| Author |
Message |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Tue Jan 08, 2008 9:49 am Post subject: |
|
|
I donwloaded latest version when I tried. If you made something new meanwhile, I will check it out.
Btw, why don't you create some normal documentation for this, preferably with several examples like:
| Code: | | msgbox % ez_invoke("pwb.doc.getElementsByTagName[td].item[0].innerHTML") |
It would be good to mention how to access some typical things. I myself had problem to access javascript array defined with new Array() command.
If you make natural docs documentation, I will be more then happy to compile it into html for you, or you can eventualy use Titan's xndocs with subset of ndoc syntax. _________________
 |
|
| Back to top |
|
 |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 422 Location: Galil, Israel
|
Posted: Wed Jan 09, 2008 2:56 am Post subject: |
|
|
| majkinetor wrote: | I donwloaded latest version when I tried. If you made something new meanwhile, I will check it out.
...
It would be good to mention how to access some typical things. I myself had problem to access javascript array defined with new Array() command.
If you make natural docs documentation, I will be more then happy to compile it into html for you, or you can eventualy use Titan's xndocs with subset of ndoc syntax. |
ok, 1. am not knowing if the Java DOMs are actually invokeable.
2. am not real clear on natural docs, nor xndocs nor ndoc syntax.
3. file has been updated, but old vers also worked for me. try and make sure you have most current COM.ahk as well ? _________________ Joyce Jamce |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Wed Jan 09, 2008 9:46 am Post subject: |
|
|
| Quote: | | 1. am not knowing if the Java DOMs are actually invokeable. |
Hm.... but I can get any variable using pWin. There must be a way to get the array, this way or another.
| Quote: | | 2. am not real clear on natural docs, nor xndocs nor ndoc syntax. |
You write COM stuff and you are "not real clear on natural docs" ?
You are insulting my intelegence now...
I hope that you are aware that progress we take as a community can only be done over small steps of individuals. Small steps.
| Quote: | | File has been updated, but old vers also worked for me. try and make sure you have most current COM.ahk as well ? |
I will check it out. Thx _________________
 |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2558 Location: Australia, Qld
|
Posted: Wed Jan 09, 2008 12:02 pm Post subject: |
|
|
Where ieWin is a pointer to a window object, the following shows "second":
| Code: | COM_Invoke(ieWin,"execScript","arr = new Array('first', 'second', 'third');")
MsgBox % COM_Invoke(COM_Invoke(ieWin,"arr"), "1")
| So it seems array items are simply properties of the Array object, named by zero-based index. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Wed Jan 09, 2008 12:59 pm Post subject: |
|
|
Thx lexikos. I was (totaly dummy) trying with:
| Code: | | Com_Invoke_(ieWin, "arr", "1") |
I have another question if anybody can answer:
Is there any way to get informed on some DOM element events, like onclick.
For instance, I have HTML with 3 buttons and I want to run AHK code when each of them is clicked. I am primarly interested in scenarios when html page is created from ahk code, so I dont need to think about third-party onclick handlers, although, redirecting existing handlers and calling originals after preprocessing event may be used for some powerful techniques. _________________
 |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2558 Location: Australia, Qld
|
Posted: Wed Jan 09, 2008 6:14 pm Post subject: |
|
|
| majkinetor wrote: | | Is there any way to get informed on some DOM element events, like onclick. | See my post, Handling Individual Events, in COM Event Handler. The example hooks window.onscroll. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Wed Jan 09, 2008 6:23 pm Post subject: |
|
|
I know about it, that was the base for my work... but that is not DOM event but WebControl event, right ? _________________
 |
|
| Back to top |
|
 |
COMTTS Guest
|
Posted: Wed Jan 09, 2008 6:24 pm Post subject: |
|
|
To lexikos
Thank you for your script.
But if you find time later can you show us a code
that excutes ahk code(e.g : msgbox, picture clicked etc.)
when we click a picture or text in html?
Maj is trying to use a html as a flexible GUI, I guess.
If you show us some code, it will be very useful only to me, but to almost everyone here  |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Wed Jan 09, 2008 6:32 pm Post subject: |
|
|
I will show you the code soon. I didn't get so far some things like KeyPress etc... I would be interested to see that as well notification about focus change .
Currently I have working code that starts your HTML GUI and when you press Save button, Gui is dismissed and you get info about all contained controls. OFC, you can set controls using scriptExec any time, and set initials by constructing the HTML from AHK. _________________
 |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2558 Location: Australia, Qld
|
Posted: Thu Jan 10, 2008 6:06 am Post subject: |
|
|
| majkinetor wrote: | | I know about it, that was the base for my work... but that is not DOM event but WebControl event, right ? | Wrong. The window object is part of DOM. I've used the same code to hook onscroll of HTML elements.
| COMTTS wrote: | But if you find time later can you show us a code
that excutes ahk code(e.g : msgbox, picture clicked etc.)
when we click a picture or text in html? | I have a script that allows (specifically designed) AutoHotkey functions to be called from JavaScript. I'll post it when I get time.
Edit: See DispatchObj (prototype).
Last edited by Lexikos on Thu Jan 10, 2008 10:53 am; edited 1 time in total |
|
| Back to top |
|
 |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 422 Location: Galil, Israel
|
Posted: Thu Jan 10, 2008 7:50 am Post subject: |
|
|
just a syntax note, if helpful that | Code: | | MsgBox % COM_Invoke(COM_Invoke(ieWin,"arr"), "1") | can be also | Code: | | MsgBox % ez_Invoke("ieWin.arr[1]") | assuming #_ieWin properly set. _________________ Joyce Jamce |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2558 Location: Australia, Qld
|
Posted: Thu Jan 10, 2008 9:17 am Post subject: |
|
|
| Joy2DWorld wrote: | just a syntax note, if helpful that | Code: | | MsgBox % COM_Invoke(COM_Invoke(ieWin,"arr"), "1") | can be also | Code: | | MsgBox % ez_Invoke("ieWin.arr[1]") | assuming #_ieWin properly set. | That does not work. It is my understanding that [1] is treated as a parameter for invoking ieWin.arr. This works for some objects, which have a default method (like Item()), but does not work for arrays created with "new Array()".
1 is in fact a property of arr, so the following shows "second" twice:
| Code: | COM_Invoke(ieWin,"execScript","arr = new Array('first', 'second', 'third');")
MsgBox % COM_Invoke(COM_Invoke(ieWin,"arr"), "1")
#_ieWin := ieWin
MsgBox % ez_Invoke("ieWin.arr.1")
|
|
|
| Back to top |
|
 |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 422 Location: Galil, Israel
|
Posted: Thu Jan 10, 2008 4:26 pm Post subject: |
|
|
yes... U B 100% correct. | Code: | | ez_Invoke("ieWin.arr.1") | works a whole lot better! _________________ Joyce Jamce |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 679
|
Posted: Wed Jan 16, 2008 10:20 pm Post subject: |
|
|
Might be that im dumb and noobie but im still having a same error as majkinator posted on page one i mean its identical _________________ Read this
Com
Automate IE7 with Tabs |
|
| Back to top |
|
 |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 422 Location: Galil, Israel
|
Posted: Thu Jan 17, 2008 1:12 am Post subject: |
|
|
The real genius behind this is SEAN'S.
USE THE LATEST VERSION OF SEAN'S COM.AHK.  _________________ Joyce Jamce |
|
| Back to top |
|
 |
|