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 

Basic Webpage Controls with JavaScript / COM - Tutorial
Goto page Previous  1, 2, 3, 4, 5 ... 15, 16, 17  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
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%
 86%  [ 91 ]
Nope - I think this tutorial is a waste of web space.
0%
 0%  [ 1 ]
I think this tutorial would be better if it incorporated AHK_L & COM_L.
12%
 12%  [ 13 ]
Total Votes : 105

Author Message
fragman



Joined: 13 Oct 2009
Posts: 1199

PostPosted: Wed Dec 30, 2009 5:00 pm    Post subject: Reply with quote

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



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Wed Dec 30, 2009 5:12 pm    Post subject: Reply with quote

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



Joined: 13 Oct 2009
Posts: 1199

PostPosted: Thu Dec 31, 2009 10:34 am    Post subject: Reply with quote

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



Joined: 18 Mar 2008
Posts: 5044
Location: the tunnel(?=light)

PostPosted: Mon Jan 04, 2010 5:22 pm    Post subject: Reply with quote

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



Joined: 23 Nov 2009
Posts: 8

PostPosted: Wed Jan 06, 2010 10:10 am    Post subject: Reply with quote

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



Joined: 23 Nov 2009
Posts: 8

PostPosted: Wed Jan 06, 2010 10:11 am    Post subject: Reply with quote

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



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Wed Jan 06, 2010 3:56 pm    Post subject: Reply with quote

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.
_________________
Very Happy - in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Gundeck



Joined: 26 Jan 2010
Posts: 5

PostPosted: Tue Jan 26, 2010 5:21 pm    Post subject: Yeah.. I'm totally NOOB Reply with quote

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



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Tue Jan 26, 2010 5:47 pm    Post subject: Reply with quote

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)

_________________
Very Happy - in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
spoonerelo
Guest





PostPosted: Wed Jan 27, 2010 4:34 pm    Post subject: firefox Reply with quote

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

PostPosted: Wed Jan 27, 2010 4:36 pm    Post subject: Reply with quote

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



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Wed Jan 27, 2010 5:46 pm    Post subject: Reply with quote

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}

_________________
Very Happy - in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Gundeck



Joined: 26 Jan 2010
Posts: 5

PostPosted: Mon Feb 01, 2010 8:56 pm    Post subject: Reply with quote

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 Confused
Back to top
View user's profile Send private message
randallf



Joined: 06 Jul 2009
Posts: 678

PostPosted: Wed Feb 03, 2010 4:49 pm    Post subject: Reply with quote

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



Joined: 06 Jul 2009
Posts: 678

PostPosted: Wed Feb 03, 2010 4:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5 ... 15, 16, 17  Next
Page 4 of 17

 
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