Detecting IE windows/urls from script 
Author Message
 Detecting IE windows/urls from script

Is it possible to detect the url of a IE pop up browser subwindow
(or a main IE window) using wsh / VBScript ?
..  or must one enumerate the system windows/processes to get at this information?

Thanks,
 - Mitch Gallant
    http://www.*-*-*.com/ ~neutron/java.html



Sat, 18 Sep 2004 23:36:41 GMT  
 Detecting IE windows/urls from script
set shellApp = createobject("shell.application")
for each w in shellApp.windows
  wscript.echo _
    "typename(w) -> " & typename(w) & vbcrlf _
  & "typename(w.document) -> " & typename(w.document) & vbcrlf _
  & "w.locationUrl -> " & w.locationUrl
next

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--

Quote:

> Is it possible to detect the url of a IE pop up browser subwindow
> (or a main IE window) using wsh / vbscript ?
> ..  or must one enumerate the system windows/processes to get at this information?

> Thanks,
>  - Mitch Gallant
>    http://home.istar.ca/~neutron/java.html



Sun, 19 Sep 2004 02:02:57 GMT  
 Detecting IE windows/urls from script
Thanks Michael. This is what I was hoping to find.
 - Mitch
Quote:

> set shellApp = createobject("shell.application")
> for each w in shellApp.windows
>   wscript.echo _
>     "typename(w) -> " & typename(w) & vbcrlf _
>   & "typename(w.document) -> " & typename(w.document) & vbcrlf _
>   & "w.locationUrl -> " & w.locationUrl
> next

> --
> Michael Harris
> Microsoft.MVP.Scripting
> Seattle WA US
> --


> > Is it possible to detect the url of a IE pop up browser subwindow
> > (or a main IE window) using wsh / vbscript ?
> > ..  or must one enumerate the system windows/processes to get at this information?

> > Thanks,
> >  - Mitch Gallant
> >    http://home.istar.ca/~neutron/java.html



Sun, 19 Sep 2004 03:14:54 GMT  
 Detecting IE windows/urls from script
btw, is it possible to handle events fired by one of these enumerated
InternetExplorer window objects instantiated in this enumeration ??

I already know about the approach using:
  set ie = wscript.createobject("internetexplorer.application","ie_")  etc..
from a thread  "IE.App eventing with Jscript" indicating some problems
with the event handlers firing properly.

Thanks,
 - Mitch

Quote:

> Thanks Michael. This is what I was hoping to find.
>  - Mitch


> > set shellApp = createobject("shell.application")
> > for each w in shellApp.windows
> >   wscript.echo _
> >     "typename(w) -> " & typename(w) & vbcrlf _
> >   & "typename(w.document) -> " & typename(w.document) & vbcrlf _
> >   & "w.locationUrl -> " & w.locationUrl
> > next

> > --
> > Michael Harris
> > Microsoft.MVP.Scripting
> > Seattle WA US
> > --


> > > Is it possible to detect the url of a IE pop up browser subwindow
> > > (or a main IE window) using wsh / vbscript ?
> > > ..  or must one enumerate the system windows/processes to get at this information?

> > > Thanks,
> > >  - Mitch Gallant
> > >    http://home.istar.ca/~neutron/java.html



Sun, 19 Sep 2004 04:37:35 GMT  
 Detecting IE windows/urls from script
Unfortunately, the WScript.ConnectObject method doesn't work with an existing IE object.  ScriptX (www.meadroid.com) has the capability to sink events of an arbitrary IE object instance (see the wshie.vbs example in the gen_samples folder, assuming you have ScriptX downloaded and installed).

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--

Quote:

> btw, is it possible to handle events fired by one of these enumerated
> InternetExplorer window objects instantiated in this enumeration ??

> I already know about the approach using:
>   set ie = wscript.createobject("internetexplorer.application","ie_")  etc..
> from a thread  "IE.App eventing with Jscript" indicating some problems
> with the event handlers firing properly.

> Thanks,
>  - Mitch


> > Thanks Michael. This is what I was hoping to find.
> >  - Mitch


> > > set shellApp = createobject("shell.application")
> > > for each w in shellApp.windows
> > >   wscript.echo _
> > >     "typename(w) -> " & typename(w) & vbcrlf _
> > >   & "typename(w.document) -> " & typename(w.document) & vbcrlf _
> > >   & "w.locationUrl -> " & w.locationUrl
> > > next

> > > --
> > > Michael Harris
> > > Microsoft.MVP.Scripting
> > > Seattle WA US
> > > --


> > > > Is it possible to detect the url of a IE pop up browser subwindow
> > > > (or a main IE window) using wsh / vbscript ?
> > > > ..  or must one enumerate the system windows/processes to get at this information?

> > > > Thanks,
> > > >  - Mitch Gallant
> > > >    http://home.istar.ca/~neutron/java.html



Sun, 19 Sep 2004 08:17:20 GMT  
 Detecting IE windows/urls from script
Another question related to this:
 I have a script , which needs to:
  - make some system config changes to IE, with some instances of IE possible open
  - detect all instances of IE and shut them down (no problem using
     Shellapp.windows  as below, and window.quit)
  - restart IE using CreateObject("internetexplorer.application","ie_")  and navigate to some url

Are there timing issues with shutting down and restarting IE so that IE config. changes
take effect?

Thanks,
 - Mitch Gallant

Quote:

> Unfortunately, the WScript.ConnectObject method doesn't work with an existing IE object.  ScriptX (www.meadroid.com) has the capability to sink events of an arbitrary IE object instance (see the wshie.vbs example in the gen_samples folder, assuming you have ScriptX downloaded and installed).

> --
> Michael Harris
> Microsoft.MVP.Scripting
> Seattle WA US
> --

> > btw, is it possible to handle events fired by one of these enumerated
> > InternetExplorer window objects instantiated in this enumeration ??

> > I already know about the approach using:
> >   set ie = wscript.createobject("internetexplorer.application","ie_")  etc..
> > from a thread  "IE.App eventing with Jscript" indicating some problems
> > with the event handlers firing properly.

> > Thanks,
> >  - Mitch


> > > Thanks Michael. This is what I was hoping to find.
> > >  - Mitch


> > > > set shellApp = createobject("shell.application")
> > > > for each w in shellApp.windows
> > > >   wscript.echo _
> > > >     "typename(w) -> " & typename(w) & vbcrlf _
> > > >   & "typename(w.document) -> " & typename(w.document) & vbcrlf _
> > > >   & "w.locationUrl -> " & w.locationUrl
> > > > next

> > > > --
> > > > Michael Harris
> > > > Microsoft.MVP.Scripting
> > > > Seattle WA US
> > > > --


> > > > > Is it possible to detect the url of a IE pop up browser subwindow
> > > > > (or a main IE window) using wsh / vbscript ?
> > > > > ..  or must one enumerate the system windows/processes to get at this information?

> > > > > Thanks,
> > > > >  - Mitch Gallant
> > > > >    http://home.istar.ca/~neutron/java.html



Wed, 19 Jan 2005 02:39:30 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Windows Script Host Shell Object (Malacious script detected)

2. detecting IE window

3. IE 6 or IIS mangling URLs

4. Firing events on a parent IE window from a child IE window

5. Hell of a Time - Detect Plugins, Close Parent Window, Detect 128 bit Encryption Browser, create Shortcut

6. Can't open URLs in frames in new window

7. Open URLs on same browser window

8. Detecting an app window from script

9. How to detect a window an active window ?

10. Problems Installing Windows Script 5.0 and Windows Script Host 2.0 Beta on Windows NT 4.0

11. Can i detect the detect IE File Download window is closed?

12. calling scripts in other IE windows (and thread synchronization)

 

 
Powered by phpBB® Forum Software