Activating Word and IE using AutoIe and Windows script
Tags:
-
Internet Explorer
-
Microsoft
-
Windows
Last response: in Windows 95/98/ME
Larry
July 31, 2005 7:26:00 AM
Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.win98.gen_discussion (More info?)
I created a .vbs file using AutoIt code to activate the open instance of
Word. It works fine, and is faster than the Windows script I had used
for the same purpose:
Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
oAutoIt.WinActivate "Microsoft Word", ""
However, I couldn't do same thing with IE, because with AutoIt the title
must include the specific title that appears, and with IE the first
thing that appears is not "Internet Explorer" but the title of the
particular document, and there's no way to know what that title will be.
So I couldn't get this AutoIt code to work for IE:
Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
' [none of these three alternative lines would work]
oAutoIt.WinActivate "Title - Internet Explorer", ""
oAutoIt.WinActivate "Internet Explorer", ""
oAutoIt.WinActivate """ - Internet Explorer", ""
So I went back and used regular Windows script instead that I had
previously used for Word, and it works for IE. This activates the most
recently activated instance of IE:
Option Explicit
dim w
With WScript.CreateObject("WScript.Shell")
w = .AppActivate("Internet Explorer")
End With
This is a great convenience, which I recommend to anyone. Suppose I
have eight windows open including two IE windows and I want to do a
google search. I want to open one of the IE windows in order to access
the Google toolbar that is installed on my IE. I either have to hit
Alt+Tab several times to get to one of the IE instances, or reach for
the Mouse and click the pointer on the taskbar, which is inefficient.
But with this .vbs file, all I do is press Winkey+G which I've assigned
to the .vbs file. That instantly activates the most recently activated
IE window, and then I press Alt+G to put the cursor in the Google search
window in the Google toolbar. Something that use to take a few steps is
now almost instant.
Larry
I created a .vbs file using AutoIt code to activate the open instance of
Word. It works fine, and is faster than the Windows script I had used
for the same purpose:
Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
oAutoIt.WinActivate "Microsoft Word", ""
However, I couldn't do same thing with IE, because with AutoIt the title
must include the specific title that appears, and with IE the first
thing that appears is not "Internet Explorer" but the title of the
particular document, and there's no way to know what that title will be.
So I couldn't get this AutoIt code to work for IE:
Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
' [none of these three alternative lines would work]
oAutoIt.WinActivate "Title - Internet Explorer", ""
oAutoIt.WinActivate "Internet Explorer", ""
oAutoIt.WinActivate """ - Internet Explorer", ""
So I went back and used regular Windows script instead that I had
previously used for Word, and it works for IE. This activates the most
recently activated instance of IE:
Option Explicit
dim w
With WScript.CreateObject("WScript.Shell")
w = .AppActivate("Internet Explorer")
End With
This is a great convenience, which I recommend to anyone. Suppose I
have eight windows open including two IE windows and I want to do a
google search. I want to open one of the IE windows in order to access
the Google toolbar that is installed on my IE. I either have to hit
Alt+Tab several times to get to one of the IE instances, or reach for
the Mouse and click the pointer on the taskbar, which is inefficient.
But with this .vbs file, all I do is press Winkey+G which I've assigned
to the .vbs file. That instantly activates the most recently activated
IE window, and then I press Alt+G to put the cursor in the Google search
window in the Google toolbar. Something that use to take a few steps is
now almost instant.
Larry
More about : activating word autoie windows script
Anonymous
July 31, 2005 9:45:00 PM
Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.win98.gen_discussion (More info?)
Larry wrote:
> I created a .vbs file using AutoIt code to activate the open instance of
> Word. It works fine, and is faster than the Windows script I had used
> for the same purpose:
>
> Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> oAutoIt.WinActivate "Microsoft Word", ""
>
> However, I couldn't do same thing with IE, because with AutoIt the title
> must include the specific title that appears, and with IE the first
> thing that appears is not "Internet Explorer" but the title of the
> particular document, and there's no way to know what that title will be.
> So I couldn't get this AutoIt code to work for IE:
>
> Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> ' [none of these three alternative lines would work]
> oAutoIt.WinActivate "Title - Internet Explorer", ""
> oAutoIt.WinActivate "Internet Explorer", ""
> oAutoIt.WinActivate """ - Internet Explorer", ""
>
> (snip)
Hi,
AutoIt(X) operates in one of four "Window matching" modes. The modes
are set with the AutoItSetOption function using the WinTitleMatchMode
option. To specify ANY substring of the window title you want to match,
set the mode to 2. Also, the Windows titles and text are case
sensitive. More about the different modes in AutoItX's help file.
Example that should make it work for you:
Set oAutoIt = CreateObject("AutoItX3.Control")
oAutoIt.AutoItSetOption "WinTitleMatchMode", 2
oAutoIt.WinActivate "Internet Explorer", ""
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
Larry wrote:
> I created a .vbs file using AutoIt code to activate the open instance of
> Word. It works fine, and is faster than the Windows script I had used
> for the same purpose:
>
> Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> oAutoIt.WinActivate "Microsoft Word", ""
>
> However, I couldn't do same thing with IE, because with AutoIt the title
> must include the specific title that appears, and with IE the first
> thing that appears is not "Internet Explorer" but the title of the
> particular document, and there's no way to know what that title will be.
> So I couldn't get this AutoIt code to work for IE:
>
> Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> ' [none of these three alternative lines would work]
> oAutoIt.WinActivate "Title - Internet Explorer", ""
> oAutoIt.WinActivate "Internet Explorer", ""
> oAutoIt.WinActivate """ - Internet Explorer", ""
>
> (snip)
Hi,
AutoIt(X) operates in one of four "Window matching" modes. The modes
are set with the AutoItSetOption function using the WinTitleMatchMode
option. To specify ANY substring of the window title you want to match,
set the mode to 2. Also, the Windows titles and text are case
sensitive. More about the different modes in AutoItX's help file.
Example that should make it work for you:
Set oAutoIt = CreateObject("AutoItX3.Control")
oAutoIt.AutoItSetOption "WinTitleMatchMode", 2
oAutoIt.WinActivate "Internet Explorer", ""
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
Larry
July 31, 2005 9:45:01 PM
Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.win98.gen_discussion (More info?)
Yes, that works. .Thanks.
But the AutoIt Help files seem rather skimpy as to details.
Another question: Could I use AutoIt to close all open windows?
Larry
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:eDEafcelFHA.3828@TK2MSFTNGP12.phx.gbl...
> Larry wrote:
>
> > I created a .vbs file using AutoIt code to activate the open
instance of
> > Word. It works fine, and is faster than the Windows script I had
used
> > for the same purpose:
> >
> > Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> > oAutoIt.WinActivate "Microsoft Word", ""
> >
> > However, I couldn't do same thing with IE, because with AutoIt the
title
> > must include the specific title that appears, and with IE the first
> > thing that appears is not "Internet Explorer" but the title of the
> > particular document, and there's no way to know what that title will
be.
> > So I couldn't get this AutoIt code to work for IE:
> >
> > Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> > ' [none of these three alternative lines would work]
> > oAutoIt.WinActivate "Title - Internet Explorer", ""
> > oAutoIt.WinActivate "Internet Explorer", ""
> > oAutoIt.WinActivate """ - Internet Explorer", ""
> >
> > (snip)
> Hi,
>
> AutoIt(X) operates in one of four "Window matching" modes. The modes
> are set with the AutoItSetOption function using the WinTitleMatchMode
> option. To specify ANY substring of the window title you want to
match,
> set the mode to 2. Also, the Windows titles and text are case
> sensitive. More about the different modes in AutoItX's help file.
>
> Example that should make it work for you:
>
> Set oAutoIt = CreateObject("AutoItX3.Control")
> oAutoIt.AutoItSetOption "WinTitleMatchMode", 2
> oAutoIt.WinActivate "Internet Explorer", ""
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.m...
Yes, that works. .Thanks.
But the AutoIt Help files seem rather skimpy as to details.
Another question: Could I use AutoIt to close all open windows?
Larry
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:eDEafcelFHA.3828@TK2MSFTNGP12.phx.gbl...
> Larry wrote:
>
> > I created a .vbs file using AutoIt code to activate the open
instance of
> > Word. It works fine, and is faster than the Windows script I had
used
> > for the same purpose:
> >
> > Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> > oAutoIt.WinActivate "Microsoft Word", ""
> >
> > However, I couldn't do same thing with IE, because with AutoIt the
title
> > must include the specific title that appears, and with IE the first
> > thing that appears is not "Internet Explorer" but the title of the
> > particular document, and there's no way to know what that title will
be.
> > So I couldn't get this AutoIt code to work for IE:
> >
> > Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> > ' [none of these three alternative lines would work]
> > oAutoIt.WinActivate "Title - Internet Explorer", ""
> > oAutoIt.WinActivate "Internet Explorer", ""
> > oAutoIt.WinActivate """ - Internet Explorer", ""
> >
> > (snip)
> Hi,
>
> AutoIt(X) operates in one of four "Window matching" modes. The modes
> are set with the AutoItSetOption function using the WinTitleMatchMode
> option. To specify ANY substring of the window title you want to
match,
> set the mode to 2. Also, the Windows titles and text are case
> sensitive. More about the different modes in AutoItX's help file.
>
> Example that should make it work for you:
>
> Set oAutoIt = CreateObject("AutoItX3.Control")
> oAutoIt.AutoItSetOption "WinTitleMatchMode", 2
> oAutoIt.WinActivate "Internet Explorer", ""
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.m...
Related resources
- i am using windows 8.1 os and cant configure my camera i.e DSL-932l what do i do now as i have lost the installation cd - Forum
- What about for other versions? I have Windows 7 home premium and need to be able to use IE 8 or 9. - Forum
- IE restricted this webpage from running scripts or active x controls - Forum
- cannot download anything windows 7 using ie11 64bit - Forum
- cannot download anything windows 7 using ie11 64bit - Forum
Larry
July 31, 2005 9:45:02 PM
Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.win98.gen_discussion (More info?)
Yeah, I see. In the Help index, it's under Windows Title and Text
(Advanced)
Larry wrote:
> Yes, that works. .Thanks.
>
> But the AutoIt Help files seem rather skimpy as to details.
>
> Another question: Could I use AutoIt to close all open windows?
>
> Larry
>
>
>
> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in
> message news:eDEafcelFHA.3828@TK2MSFTNGP12.phx.gbl...
> > Larry wrote:
> >
> > > I created a .vbs file using AutoIt code to activate the open
> instance of
> > > Word. It works fine, and is faster than the Windows script I had
> used
> > > for the same purpose:
> > >
> > > Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> > > oAutoIt.WinActivate "Microsoft Word", ""
> > >
> > > However, I couldn't do same thing with IE, because with AutoIt the
> title
> > > must include the specific title that appears, and with IE the
> > > first thing that appears is not "Internet Explorer" but the title
> > > of the particular document, and there's no way to know what that
> > > title will
> be.
> > > So I couldn't get this AutoIt code to work for IE:
> > >
> > > Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> > > ' [none of these three alternative lines would work]
> > > oAutoIt.WinActivate "Title - Internet Explorer", ""
> > > oAutoIt.WinActivate "Internet Explorer", ""
> > > oAutoIt.WinActivate """ - Internet Explorer", ""
> > >
> > > (snip)
> > Hi,
> >
> > AutoIt(X) operates in one of four "Window matching" modes. The modes
> > are set with the AutoItSetOption function using the
> > WinTitleMatchMode option. To specify ANY substring of the window
> > title you want to
> match,
> > set the mode to 2. Also, the Windows titles and text are case
> > sensitive. More about the different modes in AutoItX's help file.
> >
> > Example that should make it work for you:
> >
> > Set oAutoIt = CreateObject("AutoItX3.Control")
> > oAutoIt.AutoItSetOption "WinTitleMatchMode", 2
> > oAutoIt.WinActivate "Internet Explorer", ""
> >
> >
> > --
> > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> > Administration scripting examples and an ONLINE version of
> > the 1328 page Scripting Guide:
> > http://www.microsoft.com/technet/scriptcenter/default.m...
Yeah, I see. In the Help index, it's under Windows Title and Text
(Advanced)
Larry wrote:
> Yes, that works. .Thanks.
>
> But the AutoIt Help files seem rather skimpy as to details.
>
> Another question: Could I use AutoIt to close all open windows?
>
> Larry
>
>
>
> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in
> message news:eDEafcelFHA.3828@TK2MSFTNGP12.phx.gbl...
> > Larry wrote:
> >
> > > I created a .vbs file using AutoIt code to activate the open
> instance of
> > > Word. It works fine, and is faster than the Windows script I had
> used
> > > for the same purpose:
> > >
> > > Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> > > oAutoIt.WinActivate "Microsoft Word", ""
> > >
> > > However, I couldn't do same thing with IE, because with AutoIt the
> title
> > > must include the specific title that appears, and with IE the
> > > first thing that appears is not "Internet Explorer" but the title
> > > of the particular document, and there's no way to know what that
> > > title will
> be.
> > > So I couldn't get this AutoIt code to work for IE:
> > >
> > > Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> > > ' [none of these three alternative lines would work]
> > > oAutoIt.WinActivate "Title - Internet Explorer", ""
> > > oAutoIt.WinActivate "Internet Explorer", ""
> > > oAutoIt.WinActivate """ - Internet Explorer", ""
> > >
> > > (snip)
> > Hi,
> >
> > AutoIt(X) operates in one of four "Window matching" modes. The modes
> > are set with the AutoItSetOption function using the
> > WinTitleMatchMode option. To specify ANY substring of the window
> > title you want to
> match,
> > set the mode to 2. Also, the Windows titles and text are case
> > sensitive. More about the different modes in AutoItX's help file.
> >
> > Example that should make it work for you:
> >
> > Set oAutoIt = CreateObject("AutoItX3.Control")
> > oAutoIt.AutoItSetOption "WinTitleMatchMode", 2
> > oAutoIt.WinActivate "Internet Explorer", ""
> >
> >
> > --
> > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> > Administration scripting examples and an ONLINE version of
> > the 1328 page Scripting Guide:
> > http://www.microsoft.com/technet/scriptcenter/default.m...
Larry
July 31, 2005 9:45:02 PM
Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.win98.gen_discussion (More info?)
Now I've created an .au3 file to activate IE and (while I may be
imagining it) it seems to work slightly faster than the .vbs version of
the same code. So I'm going with the au3.
"Larry" <larry328NOSPAM@att.net> wrote in message
news:eVk5VcglFHA.3148@TK2MSFTNGP09.phx.gbl...
> Yes, that works. .Thanks.
>
> But the AutoIt Help files seem rather skimpy as to details.
>
> Another question: Could I use AutoIt to close all open windows?
>
> Larry
>
>
>
> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in
message
> news:eDEafcelFHA.3828@TK2MSFTNGP12.phx.gbl...
> > Larry wrote:
> >
> > > I created a .vbs file using AutoIt code to activate the open
> instance of
> > > Word. It works fine, and is faster than the Windows script I had
> used
> > > for the same purpose:
> > >
> > > Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> > > oAutoIt.WinActivate "Microsoft Word", ""
> > >
> > > However, I couldn't do same thing with IE, because with AutoIt the
> title
> > > must include the specific title that appears, and with IE the
first
> > > thing that appears is not "Internet Explorer" but the title of the
> > > particular document, and there's no way to know what that title
will
> be.
> > > So I couldn't get this AutoIt code to work for IE:
> > >
> > > Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> > > ' [none of these three alternative lines would work]
> > > oAutoIt.WinActivate "Title - Internet Explorer", ""
> > > oAutoIt.WinActivate "Internet Explorer", ""
> > > oAutoIt.WinActivate """ - Internet Explorer", ""
> > >
> > > (snip)
> > Hi,
> >
> > AutoIt(X) operates in one of four "Window matching" modes. The modes
> > are set with the AutoItSetOption function using the
WinTitleMatchMode
> > option. To specify ANY substring of the window title you want to
> match,
> > set the mode to 2. Also, the Windows titles and text are case
> > sensitive. More about the different modes in AutoItX's help file.
> >
> > Example that should make it work for you:
> >
> > Set oAutoIt = CreateObject("AutoItX3.Control")
> > oAutoIt.AutoItSetOption "WinTitleMatchMode", 2
> > oAutoIt.WinActivate "Internet Explorer", ""
> >
> >
> > --
> > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> > Administration scripting examples and an ONLINE version of
> > the 1328 page Scripting Guide:
> > http://www.microsoft.com/technet/scriptcenter/default.m...
>
>
Now I've created an .au3 file to activate IE and (while I may be
imagining it) it seems to work slightly faster than the .vbs version of
the same code. So I'm going with the au3.
"Larry" <larry328NOSPAM@att.net> wrote in message
news:eVk5VcglFHA.3148@TK2MSFTNGP09.phx.gbl...
> Yes, that works. .Thanks.
>
> But the AutoIt Help files seem rather skimpy as to details.
>
> Another question: Could I use AutoIt to close all open windows?
>
> Larry
>
>
>
> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in
message
> news:eDEafcelFHA.3828@TK2MSFTNGP12.phx.gbl...
> > Larry wrote:
> >
> > > I created a .vbs file using AutoIt code to activate the open
> instance of
> > > Word. It works fine, and is faster than the Windows script I had
> used
> > > for the same purpose:
> > >
> > > Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> > > oAutoIt.WinActivate "Microsoft Word", ""
> > >
> > > However, I couldn't do same thing with IE, because with AutoIt the
> title
> > > must include the specific title that appears, and with IE the
first
> > > thing that appears is not "Internet Explorer" but the title of the
> > > particular document, and there's no way to know what that title
will
> be.
> > > So I couldn't get this AutoIt code to work for IE:
> > >
> > > Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
> > > ' [none of these three alternative lines would work]
> > > oAutoIt.WinActivate "Title - Internet Explorer", ""
> > > oAutoIt.WinActivate "Internet Explorer", ""
> > > oAutoIt.WinActivate """ - Internet Explorer", ""
> > >
> > > (snip)
> > Hi,
> >
> > AutoIt(X) operates in one of four "Window matching" modes. The modes
> > are set with the AutoItSetOption function using the
WinTitleMatchMode
> > option. To specify ANY substring of the window title you want to
> match,
> > set the mode to 2. Also, the Windows titles and text are case
> > sensitive. More about the different modes in AutoItX's help file.
> >
> > Example that should make it work for you:
> >
> > Set oAutoIt = CreateObject("AutoItX3.Control")
> > oAutoIt.AutoItSetOption "WinTitleMatchMode", 2
> > oAutoIt.WinActivate "Internet Explorer", ""
> >
> >
> > --
> > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> > Administration scripting examples and an ONLINE version of
> > the 1328 page Scripting Guide:
> > http://www.microsoft.com/technet/scriptcenter/default.m...
>
>
Anonymous
August 1, 2005 2:59:14 AM
Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.win98.gen_discussion (More info?)
Larry wrote:
> Yes, that works. .Thanks.
>
> But the AutoIt Help files seem rather skimpy as to details.
>
> Another question: Could I use AutoIt to close all open windows?
>
Hi,
With AutoIt (the standalone script language), yes, with AutoItX (the
component you use from VBScript), no.
The reason for this is that AutoIt have a WinList function that can
return an array of all top-level windows, while this function is
missing in the AutoItX component (but who knows, maybe it will be
added in a later version).
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
Larry wrote:
> Yes, that works. .Thanks.
>
> But the AutoIt Help files seem rather skimpy as to details.
>
> Another question: Could I use AutoIt to close all open windows?
>
Hi,
With AutoIt (the standalone script language), yes, with AutoItX (the
component you use from VBScript), no.
The reason for this is that AutoIt have a WinList function that can
return an array of all top-level windows, while this function is
missing in the AutoItX component (but who knows, maybe it will be
added in a later version).
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
Larry
August 1, 2005 3:56:17 AM
Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.win98.gen_discussion (More info?)
Well, here's some sample code from AutoIt Help. I put this in an .au3
file and it makes a series of msg boxes appear each with the title of an
open window along with some other information. The language is quite
different from VB and I don't know how to manipulate it How would I
make this simply close all the open Windows (and of course ask for
changes to be saved if that's needed)?
$var = WinList()
For $i = 1 to $var[0][0]
; Only display visble windows that have a title
If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" &
$var[$i][1])
EndIf
Next
Func IsVisible($handle)
If BitAnd( WinGetState($handle), 2 ) Then
Return 1
Else
Return 0
EndIf
EndFunc
Torgeir Bakken (MVP) wrote:
> Larry wrote:
>
> > Yes, that works. .Thanks.
> >
> > But the AutoIt Help files seem rather skimpy as to details.
> >
> > Another question: Could I use AutoIt to close all open windows?
> >
> Hi,
>
> With AutoIt (the standalone script language), yes, with AutoItX (the
> component you use from VBScript), no.
>
> The reason for this is that AutoIt have a WinList function that can
> return an array of all top-level windows, while this function is
> missing in the AutoItX component (but who knows, maybe it will be
> added in a later version).
Well, here's some sample code from AutoIt Help. I put this in an .au3
file and it makes a series of msg boxes appear each with the title of an
open window along with some other information. The language is quite
different from VB and I don't know how to manipulate it How would I
make this simply close all the open Windows (and of course ask for
changes to be saved if that's needed)?
$var = WinList()
For $i = 1 to $var[0][0]
; Only display visble windows that have a title
If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" &
$var[$i][1])
EndIf
Next
Func IsVisible($handle)
If BitAnd( WinGetState($handle), 2 ) Then
Return 1
Else
Return 0
EndIf
EndFunc
Torgeir Bakken (MVP) wrote:
> Larry wrote:
>
> > Yes, that works. .Thanks.
> >
> > But the AutoIt Help files seem rather skimpy as to details.
> >
> > Another question: Could I use AutoIt to close all open windows?
> >
> Hi,
>
> With AutoIt (the standalone script language), yes, with AutoItX (the
> component you use from VBScript), no.
>
> The reason for this is that AutoIt have a WinList function that can
> return an array of all top-level windows, while this function is
> missing in the AutoItX component (but who knows, maybe it will be
> added in a later version).
Anonymous
August 1, 2005 5:43:09 PM
Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.win98.gen_discussion (More info?)
Larry wrote:
> Well, here's some sample code from AutoIt Help. I put this in an .au3
> file and it makes a series of msg boxes appear each with the title of an
> open window along with some other information. The language is quite
> different from VB and I don't know how to manipulate it How would I
> make this simply close all the open Windows (and of course ask for
> changes to be saved if that's needed)?
>
>
> $var = WinList()
>
> For $i = 1 to $var[0][0]
> ; Only display visble windows that have a title
> If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
> MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" &
> $var[$i][1])
> EndIf
> Next
>
> Func IsVisible($handle)
> If BitAnd( WinGetState($handle), 2 ) Then
> Return 1
> Else
> Return 0
> EndIf
>
> EndFunc
>
Hi,
Instead of feeding the found titles into the MsgBox function, feed
it into the WinClose function instead.
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
Larry wrote:
> Well, here's some sample code from AutoIt Help. I put this in an .au3
> file and it makes a series of msg boxes appear each with the title of an
> open window along with some other information. The language is quite
> different from VB and I don't know how to manipulate it How would I
> make this simply close all the open Windows (and of course ask for
> changes to be saved if that's needed)?
>
>
> $var = WinList()
>
> For $i = 1 to $var[0][0]
> ; Only display visble windows that have a title
> If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
> MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" &
> $var[$i][1])
> EndIf
> Next
>
> Func IsVisible($handle)
> If BitAnd( WinGetState($handle), 2 ) Then
> Return 1
> Else
> Return 0
> EndIf
>
> EndFunc
>
Hi,
Instead of feeding the found titles into the MsgBox function, feed
it into the WinClose function instead.
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
Larry
August 1, 2005 5:43:10 PM
Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.win98.gen_discussion (More info?)
Sorry for asking questions from such a newbie level here, but I got it
to work, sort of, with the below. However, this will not close
minimized windows. (I thought by "visible" maybe it meant "non
minimized," but when I commented out the second half of the If Then line
("Is Visible" etc.) it attempted to close Windows itself.)
Also if a Save As dialog appears, it blinks off and on several times
before become steady, instead of just appearing and waiting for a
response.
Also, how would I exclude an application, say Word, from this? I tried
adding this to the If Then line
And $var[$i][0] <> "Microsoft Word"
But it closed Word anyway.
$var = WinList()
For $i = 1 to $var[0][0]
; Only display visble windows that have a title
If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
WinClose("")
EndIf
Next
Func IsVisible($handle)
If BitAnd( WinGetState($handle), 2 ) Then
Return 1
Else
Return 0
EndIf
EndFunc
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news
ECfB7olFHA.3288@TK2MSFTNGP09.phx.gbl...
> Larry wrote:
>
> > Well, here's some sample code from AutoIt Help. I put this in an
..au3
> > file and it makes a series of msg boxes appear each with the title
of an
> > open window along with some other information. The language is
quite
> > different from VB and I don't know how to manipulate it How would I
> > make this simply close all the open Windows (and of course ask for
> > changes to be saved if that's needed)?
> >
> >
> > $var = WinList()
> >
> > For $i = 1 to $var[0][0]
> > ; Only display visble windows that have a title
> > If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
> > MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" &
> > $var[$i][1])
> > EndIf
> > Next
> >
> > Func IsVisible($handle)
> > If BitAnd( WinGetState($handle), 2 ) Then
> > Return 1
> > Else
> > Return 0
> > EndIf
> >
> > EndFunc
> >
> Hi,
>
> Instead of feeding the found titles into the MsgBox function, feed
> it into the WinClose function instead.
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.m...
Sorry for asking questions from such a newbie level here, but I got it
to work, sort of, with the below. However, this will not close
minimized windows. (I thought by "visible" maybe it meant "non
minimized," but when I commented out the second half of the If Then line
("Is Visible" etc.) it attempted to close Windows itself.)
Also if a Save As dialog appears, it blinks off and on several times
before become steady, instead of just appearing and waiting for a
response.
Also, how would I exclude an application, say Word, from this? I tried
adding this to the If Then line
And $var[$i][0] <> "Microsoft Word"
But it closed Word anyway.
$var = WinList()
For $i = 1 to $var[0][0]
; Only display visble windows that have a title
If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
WinClose("")
EndIf
Next
Func IsVisible($handle)
If BitAnd( WinGetState($handle), 2 ) Then
Return 1
Else
Return 0
EndIf
EndFunc
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news
ECfB7olFHA.3288@TK2MSFTNGP09.phx.gbl...> Larry wrote:
>
> > Well, here's some sample code from AutoIt Help. I put this in an
..au3
> > file and it makes a series of msg boxes appear each with the title
of an
> > open window along with some other information. The language is
quite
> > different from VB and I don't know how to manipulate it How would I
> > make this simply close all the open Windows (and of course ask for
> > changes to be saved if that's needed)?
> >
> >
> > $var = WinList()
> >
> > For $i = 1 to $var[0][0]
> > ; Only display visble windows that have a title
> > If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
> > MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" &
> > $var[$i][1])
> > EndIf
> > Next
> >
> > Func IsVisible($handle)
> > If BitAnd( WinGetState($handle), 2 ) Then
> > Return 1
> > Else
> > Return 0
> > EndIf
> >
> > EndFunc
> >
> Hi,
>
> Instead of feeding the found titles into the MsgBox function, feed
> it into the WinClose function instead.
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.m...
Anonymous
August 1, 2005 8:35:18 PM
Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.win98.gen_discussion (More info?)
Larry wrote:
> Sorry for asking questions from such a newbie level here, but I got it
> to work, sort of, with the below. However, this will not close
> minimized windows. (I thought by "visible" maybe it meant "non
> minimized," but when I commented out the second half of the If Then line
> ("Is Visible" etc.) it attempted to close Windows itself.)
>
> Also if a Save As dialog appears, it blinks off and on several times
> before become steady, instead of just appearing and waiting for a
> response.
>
> Also, how would I exclude an application, say Word, from this? I tried
> adding this to the If Then line
> And $var[$i][0] <> "Microsoft Word"
> But it closed Word anyway.
>
> (snip AutoIt v3 code)
Hi,
I'm not an expert on AutoIt v3 code, I suggest you ask in the
"v3 Support" forum at http://www.autoitscript.com/forum/index.php?
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
Larry wrote:
> Sorry for asking questions from such a newbie level here, but I got it
> to work, sort of, with the below. However, this will not close
> minimized windows. (I thought by "visible" maybe it meant "non
> minimized," but when I commented out the second half of the If Then line
> ("Is Visible" etc.) it attempted to close Windows itself.)
>
> Also if a Save As dialog appears, it blinks off and on several times
> before become steady, instead of just appearing and waiting for a
> response.
>
> Also, how would I exclude an application, say Word, from this? I tried
> adding this to the If Then line
> And $var[$i][0] <> "Microsoft Word"
> But it closed Word anyway.
>
> (snip AutoIt v3 code)
Hi,
I'm not an expert on AutoIt v3 code, I suggest you ask in the
"v3 Support" forum at http://www.autoitscript.com/forum/index.php?
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
Larry
August 1, 2005 8:35:19 PM
Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.win98.gen_discussion (More info?)
Thanks, I'll check it out.
Larry
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:e6GFDZqlFHA.2156@TK2MSFTNGP14.phx.gbl...
> Larry wrote:
>
> > Sorry for asking questions from such a newbie level here, but I got
it
> > to work, sort of, with the below. However, this will not close
> > minimized windows. (I thought by "visible" maybe it meant "non
> > minimized," but when I commented out the second half of the If Then
line
> > ("Is Visible" etc.) it attempted to close Windows itself.)
> >
> > Also if a Save As dialog appears, it blinks off and on several times
> > before become steady, instead of just appearing and waiting for a
> > response.
> >
> > Also, how would I exclude an application, say Word, from this? I
tried
> > adding this to the If Then line
> > And $var[$i][0] <> "Microsoft Word"
> > But it closed Word anyway.
> >
> > (snip AutoIt v3 code)
> Hi,
>
> I'm not an expert on AutoIt v3 code, I suggest you ask in the
> "v3 Support" forum at http://www.autoitscript.com/forum/index.php?
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.m...
Thanks, I'll check it out.
Larry
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:e6GFDZqlFHA.2156@TK2MSFTNGP14.phx.gbl...
> Larry wrote:
>
> > Sorry for asking questions from such a newbie level here, but I got
it
> > to work, sort of, with the below. However, this will not close
> > minimized windows. (I thought by "visible" maybe it meant "non
> > minimized," but when I commented out the second half of the If Then
line
> > ("Is Visible" etc.) it attempted to close Windows itself.)
> >
> > Also if a Save As dialog appears, it blinks off and on several times
> > before become steady, instead of just appearing and waiting for a
> > response.
> >
> > Also, how would I exclude an application, say Word, from this? I
tried
> > adding this to the If Then line
> > And $var[$i][0] <> "Microsoft Word"
> > But it closed Word anyway.
> >
> > (snip AutoIt v3 code)
> Hi,
>
> I'm not an expert on AutoIt v3 code, I suggest you ask in the
> "v3 Support" forum at http://www.autoitscript.com/forum/index.php?
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.m...
suske001
June 24, 2009 1:20:16 AM
Related resources
- Hai! i am using windows 7.how to install anu script manager 7.0 in pc Forum
- Hai! i am using windows 7.how to install anu script manager 7.0 in pc Forum
- why can't i download pdf files on windows 7 using IE 11 Forum
- SolvedWindows 7 cannot re-activate (Installed originally using an ISO cd-rom not an aoffical copy) Forum
- script errors using Windows 98 Starts here training CDROM Forum
- Using Windows script to paste or insert text into a new e-.. Forum
- Is it legal to download and use windows 7 and use it for 30 days without activating? Forum
- windows user creation script in active directory.... Forum
- Solvedwindows 8 crash on activation using pirate activator Forum
- Solvedcan I buy a pre-owned disk of Windows 7 and use my current activation code? Forum
- SolvedCan I use the same product key to re-activate windows? Forum
- Windows 8 and IE 10 unable to use Linksys login Forum
- Reinstalled windows xp on my son's computer, but when I tried to use IE to go on Forum
- when i m using my laptop my laptop always say to activate the window. can i know the solution? Forum
- How to use IE 5.0 in Windows XP - SP2 Forum
- More resources
!