I have a macro I want to run, yet the windo titles are extremely long. What is the best wayt o get an accurate name of the window title...
Here ar ethe examples. The seond exmaple includes quotation marks and also the | sign... I am using the WaitWindowOpen command..
Example 1.
status:Disconnected | VPN Client - Version 4.8.01.300
Challenges with spaces?? I had it working to the first window but then the program crashed...
Example 2.
VPN Client | User Authentication for "Company Name VPN"
Find out or get window titles
Moderators: Dorian (MJT support), JRL
Find out or get window titles
When All Alse Fails...
Manipulate The Data......
Manipulate The Data......
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Use the GetActiveWindow(GAW) function.
From the Help:
GetActiveWindow>window_title,X,Y[,Width,Height]
Retrieves information about the current active window. The window title, and top left coordinates of the active window are stored in window_title, X and Y.
From the Help:
GetActiveWindow>window_title,X,Y[,Width,Height]
Retrieves information about the current active window. The window title, and top left coordinates of the active window are stored in window_title, X and Y.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Get Current Window Name??
Could you help me with an example? .
This is the code I am using...
Let>Password = login password
Run Program>C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe
WaitWindowOpen>status: Disconnected | VPN Client - Version 4.8.01.0300
Press CTRL
Send>o
GetActiveWindow>window_title,X,Y[,Width,Height]
WaitWindowOpen>window_title
Send>Password
Press Enter
It is the second window that opens up and has a title of something like..
VPN Client | Client Authentication for "Company Name"
My challenge is that when I get to the second window that opens up, it will not pass the password and hit enter. I assume it is the window name.
This is the code I am using...
Let>Password = login password
Run Program>C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe
WaitWindowOpen>status: Disconnected | VPN Client - Version 4.8.01.0300
Press CTRL
Send>o
GetActiveWindow>window_title,X,Y[,Width,Height]
WaitWindowOpen>window_title
Send>Password
Press Enter
It is the second window that opens up and has a title of something like..
VPN Client | Client Authentication for "Company Name"
My challenge is that when I get to the second window that opens up, it will not pass the password and hit enter. I assume it is the window name.
When All Alse Fails...
Manipulate The Data......
Manipulate The Data......
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
See untested modifications
Let>Password=login password
Run Program>C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe
WaitWindowOpen>status: Disconnected | VPN Client - Version 4.8.01.0300*
SetFocus>status: Disconnected | VPN Client - Version 4.8.01.0300*
Press CTRL
Send>o
Release CTRL
GetActiveWindow>window_title,X,Y
WaitWindowOpen>window_title
Send>%Password%
Press Enter
===========================
Comments:
Spaces will be incorporated as part of variables in Let> commands
Usually need to do a Release after a Press with CTRL/ALT/SHIFT, etc.
Use * with window names
Use % with variables, helps ID values in logs.
Need to set focus before doing Press/Send commands
May need to press TAB a few times before doing Send> commands
Do not include unused optional parameters, or if used, keep commas but remove brackets.
Let>Password=login password
Run Program>C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe
WaitWindowOpen>status: Disconnected | VPN Client - Version 4.8.01.0300*
SetFocus>status: Disconnected | VPN Client - Version 4.8.01.0300*
Press CTRL
Send>o
Release CTRL
GetActiveWindow>window_title,X,Y
WaitWindowOpen>window_title
Send>%Password%
Press Enter
===========================
Comments:
Spaces will be incorporated as part of variables in Let> commands
Usually need to do a Release after a Press with CTRL/ALT/SHIFT, etc.
Use * with window names
Use % with variables, helps ID values in logs.
Need to set focus before doing Press/Send commands
May need to press TAB a few times before doing Send> commands
Do not include unused optional parameters, or if used, keep commas but remove brackets.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Updated - Almost working
So, I took your advice and read through a few things as well. I am now to the point when it works up until the last window. I have tried this a number of ways and still can't get it past this last step. Seems for such a simple script it takes a while to figure it out....
WaitWindowOpen>VPN Client | Banner*
I have tried GetActiveWindow, but no change......
Any help is appreciated....
Thanks for your help so far...
Code:
Let>Password=Password
Run Program>C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe
WaitWindowOpen>status: Disconnected | VPN Client - Version 4.8.01.0300*
SetFocus>status: Disconnected | VPN Client - Version 4.8.01.0300*
Press CTRL
Send>o
Release CTRL
wait>2
WaitWindowOpen>VPN Client | User Authentication for "Company VPN"*
SetFocus>VPN Client | User Authentication for "Company VPN"*
Send>%Password%
Press Enter
wait>2
WaitWindowOpen>VPN Client | Banner*
SetFocus>VPN Client | Banner*
Press Enter
End Code
WaitWindowOpen>VPN Client | Banner*
I have tried GetActiveWindow, but no change......
Any help is appreciated....
Thanks for your help so far...
Code:
Let>Password=Password
Run Program>C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe
WaitWindowOpen>status: Disconnected | VPN Client - Version 4.8.01.0300*
SetFocus>status: Disconnected | VPN Client - Version 4.8.01.0300*
Press CTRL
Send>o
Release CTRL
wait>2
WaitWindowOpen>VPN Client | User Authentication for "Company VPN"*
SetFocus>VPN Client | User Authentication for "Company VPN"*
Send>%Password%
Press Enter
wait>2
WaitWindowOpen>VPN Client | Banner*
SetFocus>VPN Client | Banner*
Press Enter
End Code
When All Alse Fails...
Manipulate The Data......
Manipulate The Data......
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact: