| View previous topic :: View next topic |
| Do you think this tutorial is beneficial to the AHK Community? |
| Yeah, I think this tutorial is a great value-add to the Community. |
|
86% |
[ 91 ] |
| Nope - I think this tutorial is a waste of web space. |
|
0% |
[ 1 ] |
| I think this tutorial would be better if it incorporated AHK_L & COM_L. |
|
12% |
[ 13 ] |
|
| Total Votes : 105 |
|
| Author |
Message |
fragman
Joined: 13 Oct 2009 Posts: 1199
|
Posted: Wed Dec 30, 2009 5:00 pm Post subject: |
|
|
How would it not be relevant? I'm using this for explorer windows, not for IE windows with tabs and it works fine there mostly.
The IEGet method should work for explorer after some customization, I haven't decided yet which one might work better. Hwnd method might be able to reach windows which incorporate a shell view? I'm not sure yet if that would be a pro or con. |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Wed Dec 30, 2009 5:12 pm Post subject: |
|
|
because the shellwindows collection is in the order created which has nothing to do with which one is active what is wrong with
| Code: | | hwnd:=WinExist("ahk_class CabinetWClass") | which would get the top most file explorer window
there is no need to go thru the complexity of rifleing thru the shellwindows collection at all unless your later planning on using COM in which case you would want the already known via winexist hwnd to be compared with the other hwnd's in the shell collection so you may arrive at a proper pwb _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
fragman
Joined: 13 Oct 2009 Posts: 1199
|
Posted: Thu Dec 31, 2009 10:34 am Post subject: |
|
|
That's exactly what I'm doing, sorry if I didn't make that clear.
I'm calling various COM functions like Navigate2, SelectFiles etc on the active explorer window. |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Mon Jan 04, 2010 5:22 pm Post subject: |
|
|
Post deleted - placed in wrong thread. _________________ Try Quick Search for Autohotkey or see the tutorial for newbies.
Last edited by sinkfaze on Wed Jan 06, 2010 1:37 pm; edited 1 time in total |
|
| Back to top |
|
 |
anomalous3
Joined: 23 Nov 2009 Posts: 8
|
Posted: Wed Jan 06, 2010 10:10 am Post subject: |
|
|
I noticed in my task manager that "iexplore.exe" stays open and munches up memory even if you use the COM_Invoke(pwb, "Quit") method, so I did some searching on the MSDN and found that I need to use the COM universal "Close" method as well to free up the resources used by the exited internet explorer object like this: | Code: | | COM_Invoke(pwb, "Close") |
|
|
| Back to top |
|
 |
anomalous3
Joined: 23 Nov 2009 Posts: 8
|
Posted: Wed Jan 06, 2010 10:11 am Post subject: |
|
|
I noticed in my task manager that "iexplore.exe" stays open and munches up memory even if you use the COM_Invoke(pwb, "Quit") method, so I did some searching on the MSDN and found that I need to use the COM universal "Close" method as well to free up the resources used by the exited internet explorer object like this: | Code: | | COM_Invoke(pwb, "Close") |
|
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Wed Jan 06, 2010 3:56 pm Post subject: |
|
|
I don't know much about the COM universal "Close" method, but are you using a different pwb (pointer) to close each WebBrowser Object? (pwb1, pwb2, pwb3 ...). Additionally, you could also use Process, Close. _________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
Gundeck
Joined: 26 Jan 2010 Posts: 5
|
Posted: Tue Jan 26, 2010 5:21 pm Post subject: Yeah.. I'm totally NOOB |
|
|
I didn't get past step 1.
I downloaded the OCM.ahk, I didn't see anything to do on the page for Standard Library.
When I copy and paste the scripts and paste it into my address bar, while on the Forum Search page... I get nothing.
I guess I'll hit some of the other listed tut's that are linked on this page.
What am I doing wrong? |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Tue Jan 26, 2010 5:47 pm Post subject: |
|
|
| Gundeck wrote: | | I downloaded the OCM.ahk, I didn't see anything to do on the page for Standard Library. | Please read this. COM.ahk goes in your "Lib" folder; the path should be something like "C:\Program Files\AutoHotkey\Lib"
| Gundeck wrote: | | When I copy and paste the scripts and paste it into my address bar, while on the Forum Search page... I get nothing. |
So, when you are on the Search Forum page and enter the following code into the URL Address bar and hit enter, nothing happens? | Code: | | javascript: document.all.search_keywords.value = 'Input Value'; void(0) |
If so, what browser are you using? I have noticed that FireFox doesn't like all, but you could use: | Code: | | javascript: document.getElementsByName('search_keywords')[0].value = 'Input Value'; void(0) |
_________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
spoonerelo Guest
|
Posted: Wed Jan 27, 2010 4:34 pm Post subject: firefox |
|
|
| Is it possible to control firefox in the same way as internet explorer? |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Wed Jan 27, 2010 4:36 pm Post subject: |
|
|
no
2 different APIs and ahk is blind to firefox _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Wed Jan 27, 2010 5:46 pm Post subject: |
|
|
| Quote: | | Is it possible to control firefox in the same way as internet explorer? |
As tank said, no, firefox is not a COM object. You could use javascript injection though, something like this: | Code: | ClipBoard := "javascript: document.getElementsByName('search_keywords')[0].value = 'Input Value'; void(0)"
Send, !d^v{Enter} |
_________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
Gundeck
Joined: 26 Jan 2010 Posts: 5
|
Posted: Mon Feb 01, 2010 8:56 pm Post subject: |
|
|
| jethrow wrote: | | Gundeck wrote: | | I downloaded the OCM.ahk, I didn't see anything to do on the page for Standard Library. | Please read this. COM.ahk goes in your "Lib" folder; the path should be something like "C:\Program Files\AutoHotkey\Lib"
| Gundeck wrote: | | When I copy and paste the scripts and paste it into my address bar, while on the Forum Search page... I get nothing. |
So, when you are on the Search Forum page and enter the following code into the URL Address bar and hit enter, nothing happens? | Code: | | javascript: document.all.search_keywords.value = 'Input Value'; void(0) |
If so, what browser are you using? I have noticed that FireFox doesn't like all, but you could use: | Code: | | javascript: document.getElementsByName('search_keywords')[0].value = 'Input Value'; void(0) |
|
Wait a minute... Shoe leather taste better with salt on it... I guess I should open my eyes.
It worked as described. I'm an idiot, sorry  |
|
| Back to top |
|
 |
randallf
Joined: 06 Jul 2009 Posts: 678
|
Posted: Wed Feb 03, 2010 4:49 pm Post subject: |
|
|
Can I use this/COM to automate the retreival of a webpage source by URL?
I have a URL to a dynamically built page, I want IE to open the window -in the background- and save the source to a file.
I was looking at this line:
text := COM_Invoke(pwb, "document.getElementsByTagName[TD].item[2].innerHTML")
But I'm not sure how to set up everything that wraps it. I just get an error...
Is there any way I could beg for an example? Thank you! |
|
| Back to top |
|
 |
randallf
Joined: 06 Jul 2009 Posts: 678
|
Posted: Wed Feb 03, 2010 4:55 pm Post subject: |
|
|
Read some more and did this, but still get an error:
| Code: | com_init()
pwb := COM_CreateObject("InternetExplorer.Application")
COM_Invoke(pwb , "Visible=", "True") ;"False" ;"True" ;
text := COM_Invoke(pwb, "document.getElementsByTagName[TD].item[2].innerHTML")
msgbox %text% |
'no com dispatch object'... what am I missing? |
|
| Back to top |
|
 |
|