AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ez_invoke() EZ-COM Wrapper ez_invoke("root.obj.prop[3
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
majkinetor



Joined: 24 May 2006
Posts: 3626
Location: Belgrade

PostPosted: Tue Jan 08, 2008 9:49 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Joy2DWorld



Joined: 04 Dec 2006
Posts: 422
Location: Galil, Israel

PostPosted: Wed Jan 09, 2008 2:56 am    Post subject: Reply with quote

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
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3626
Location: Belgrade

PostPosted: Wed Jan 09, 2008 9:46 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Lexikos



Joined: 17 Oct 2006
Posts: 2558
Location: Australia, Qld

PostPosted: Wed Jan 09, 2008 12:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3626
Location: Belgrade

PostPosted: Wed Jan 09, 2008 12:59 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Lexikos



Joined: 17 Oct 2006
Posts: 2558
Location: Australia, Qld

PostPosted: Wed Jan 09, 2008 6:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3626
Location: Belgrade

PostPosted: Wed Jan 09, 2008 6:23 pm    Post subject: Reply with quote

I know about it, that was the base for my work... but that is not DOM event but WebControl event, right ?
_________________
Back to top
View user's profile Send private message MSN Messenger
COMTTS
Guest





PostPosted: Wed Jan 09, 2008 6:24 pm    Post subject: Reply with quote

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 Laughing
Back to top
majkinetor



Joined: 24 May 2006
Posts: 3626
Location: Belgrade

PostPosted: Wed Jan 09, 2008 6:32 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Lexikos



Joined: 17 Oct 2006
Posts: 2558
Location: Australia, Qld

PostPosted: Thu Jan 10, 2008 6:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Joy2DWorld



Joined: 04 Dec 2006
Posts: 422
Location: Galil, Israel

PostPosted: Thu Jan 10, 2008 7:50 am    Post subject: Reply with quote

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
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2558
Location: Australia, Qld

PostPosted: Thu Jan 10, 2008 9:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Joy2DWorld



Joined: 04 Dec 2006
Posts: 422
Location: Galil, Israel

PostPosted: Thu Jan 10, 2008 4:26 pm    Post subject: Reply with quote

yes... U B 100% correct.
Code:
ez_Invoke("ieWin.arr.1")
works a whole lot better!
_________________
Joyce Jamce
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 679

PostPosted: Wed Jan 16, 2008 10:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
Joy2DWorld



Joined: 04 Dec 2006
Posts: 422
Location: Galil, Israel

PostPosted: Thu Jan 17, 2008 1:12 am    Post subject: Reply with quote

The real genius behind this is SEAN'S.


USE THE LATEST VERSION OF SEAN'S COM.AHK. Rolling Eyes
_________________
Joyce Jamce
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group