AutoHotkey Community

It is currently May 27th, 2012, 12:56 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 271 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 19  Next

Do you think this tutorial is beneficial to the AHK Community?
Yeah, I think this tutorial is a great value-add to the Community.
Nope - I think this tutorial is a waste of web space.
I think this tutorial would be better if it incorporated AHK_L & COM_L.
You may select 1 option

View results
Author Message
 Post subject:
PostPosted: November 30th, 2009, 6:44 pm 
Offline

Joined: April 15th, 2009, 12:05 am
Posts: 75
Location: Italy
jethrow wrote:
:shock: - Why are you using pweb & pwb? Should be:
Code:
MsgBox % COM_Invoke(pweb,"document.getElementsByTagName[h1].item[0].innerHTML")


holymoly! what a moron... (me)
that's it! just a stupid "e" bug (friggin Napier)

thx a ton jethrow and all of you guys.

_________________
Intel Centrino @ 2.8GHz
4 GB RAM
WIN XP SP3


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2009, 5:53 am 
Offline

Joined: January 7th, 2007, 1:43 pm
Posts: 107
I use the COM_U to deal with a Unicode file,an error occar.
Image
What shall I do?[/img]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2009, 6:15 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
In a function variables do not require percent signs unless you are using them dynamically (and literal text must be quoted):

Code:
COM_Invoke(pweb,"document.all.atc_content.value",A_LoopField)

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2009, 10:51 am 
Offline

Joined: January 7th, 2007, 1:43 pm
Posts: 107
sinkfaze wrote:
In a function variables do not require percent signs unless you are using them dynamically (and literal text must be quoted):

Code:
COM_Invoke(pweb,"document.all.atc_content.value",A_LoopField)

Thank you.Very good.
OK!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 25th, 2009, 7:22 pm 
Offline

Joined: October 1st, 2005, 2:09 am
Posts: 130
Location: Canada
Having a problem with an onchange + onkeyup event. Basically I am trying to put text into a field, which is working fine, and then clicking the Search button, which also works fine.

The problem comes with the field I am putting text into, is expecting you to be typing into the field. When you type into the field it then triggers the onchange / onkeyup events:
Code:
<INPUT onkeyup=fullNameParse267656572(this.value) onchange=fullNameParse267656572(this.value) value="THE TEXT I PUT IN" name="attribute.Full Name" autocomplete="off">

Using
Code:
iWeb_setDomObj(netcare,"attribute.Full Name",myName,"23,48,10")

to set the text within an iFrame, but it does not trigger the events. I tried playing with iWeb_FireEvents() to no luck.

Offtopic Edit: The "ahk web recorder" program is freaking wonderful. The only bug that threw me off at first was that it does not comma separate the first two iFrame numbers, e.g. I had iFrame one number "23" and the second was "48", and a third was "10". It gave me "2348,10". Once I changed it to "23,48,10" all worked great.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 25th, 2009, 8:49 pm 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
Try firing the onchange event like this:
Code:
element := COM_Invoke(netcare, "document.all[23].contentWindow.document.all[48].contentWindow.document.all[10].contentWindow.document.all","attribute.Full Name")
COM_Invoke(element, "fireEvent", "onchange")

btw - MERRY CHRISTMAS

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 25th, 2009, 9:49 pm 
Offline

Joined: October 1st, 2005, 2:09 am
Posts: 130
Location: Canada
jethrow wrote:
Try firing the onchange event like this:
Code:
element := COM_Invoke(netcare, "document.all[23].contentWindow.document.all[48].contentWindow.document.all[10].contentWindow.document.all","attribute.Full Name")
COM_Invoke(element, "fireEvent", "onchange")

btw - MERRY CHRISTMAS


Thank you VERY MUCH!

This is the present I needed most. :)

Seasons Greetings to all!!!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 26th, 2009, 6:31 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
incith wrote:
Offtopic Edit: The "ahk web recorder" program is freaking wonderful. The only bug that threw me off at first was that it does not comma separate the first two iFrame numbers...


A problem none of us who are working on it probably had a chance to catch because we don't have any web pages that required us to recurse that deep into frames readily available to us. The official release probably won't be updated for a week or more, in the meantime you can make this change in the script under the Ctrl+e hotkey (should be around line 181):

Code:
fpath.=(A_Index=1 ? "" : ",") ((f1) ? (f1) : ((f3) ? (f3) : (f2))) ; the ternary statements should've been reversed


And thanks for the compliments. :)

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2009, 1:00 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
I'm referring to this piece of code quoted in the first post in tanks thread from Sean:

Code:
COM_Init()
psh :=   COM_CreateObject("Shell.Application")
psw :=   COM_Invoke(psh, "Windows")
Loop, %   COM_Invoke(psw, "Count")
   pwb := COM_Invoke(psw, "Item", A_Index-1), sInfo .= COM_Invoke(pwb, "hWnd") . " : """ . COM_Invoke(pwb, "LocationURL") . """,""" . COM_Invoke(pwb, "LocationName") . """,""" . COM_Invoke(pwb, "StatusText") . """,""" . COM_Invoke(pwb, "Name") . """,""" . COM_Invoke(pwb, "FullName") . """`n", COM_Release(pwb)
COM_Release(psw)
COM_Release(psh)
COM_Term()

MsgBox, % sInfo


This produces COM errors ("Function Name: "hWnd"")
when Steam is running. Steam is using an IEFrame, so I suppose this might be related. Any idea what could be done to fix this? Personally, I am only interested in getting explorer windows. Maybe there is an explorer specific interface that could be queried or so before calling hwnd?
I already tried contacting Steam devs about this, but they don't want to investigate this from their side.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2009, 2:31 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
What is the exact error message? And have you rebooted your computer and tried the code again?

Although a portion of that code is used in the iWeb_getWin function, that specific code doesn't really have much to do with this topic (other than tank linking to it in the old thread).

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2009, 2:59 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
---------------------------
COM Error Notification
---------------------------
Function Name: "hWnd"
ERROR: Unbekannter Fehler

(0x80004005)
PROG:
DESC:
HELP: ,0

Will Continue?
---------------------------
Ja Nein
---------------------------

I tried rebooting, restarting Steam etc. this is perfectly reproducable and only happens when Steam is running. I should probably also say that I'm running Win7 32Bit. I use similar code that navigates active Explorer window, and I also see the error there. With that code it sometimes also happens when called at "unusual" places (that is, during a folder change, when closing explorer window, and I believe also sometimes in control panel, however, those happen a bit too infrequently to verify for sure what causes them).
Explorer windows that were started before Steam are not affected, probably because they are listed before the Steam IEFrame and my code breaks when it finds the correct window, so Hwnd is not called on the IEFrame of Steam.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2009, 3:23 pm 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
fragman wrote:
Personally, I am only interested in getting explorer windows. Maybe there is an explorer specific interface that could be queried or so before calling hwnd?

I would use something like this to filter out IE windows:
Code:
If pwb := COM_Invoke(psw, "Item", A_Index-1) ; ensure pwb isn't "empty"
   If Not InStr( COM_Invoke(pwb, "FullName"), "iexplore.exe" ) ; ensure pwb isn't IE

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2009, 3:57 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
Why do you need to retrieve the windows using the hWnd?

It looks like you've already covered this ground with Sean and I don't think anyone in this thread is more qualified to answer questions about this than he is. We can't answer every question about why some programs don't respond properly to a COM call, particularly when it's classified as an unknown error.

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2009, 5:10 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
Code:
If pwb := COM_Invoke(psw, "Item", A_Index-1) ; ensure pwb isn't "empty"
   If Not InStr( COM_Invoke(pwb, "FullName"), "Steam.exe" ) ; ensure pwb isn't Steam


This works very good, thank you!

I used hWnd because I wanted to capture the active window, and this seemed like the safest way.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2009, 5:23 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
and yet it isnt even relavant to the active window the way your retreiving it
IEGet from the first page of this thread is the very best way to get the top most browser window
also passing a blank name to iweb_getwin will as well

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 271 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 19  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Cristi® and 10 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group