Sign in to follow this  
Followers 0
savj14

Running a script in the background

5 posts in this topic

At work we are required to use a VPN in which case is behind a proxy server. When accessing the Internet it requires you to enter your credentials in a pop up login box. I am looking for a way to run a script throughout the day that will Send Enter every time the window pops up.

If WinWaitActive("Window Text") then
Send("{Enter}")

Now how would I loop this until I leave for the day. Maybe keep the icon in the tray and exit the script before I leave. ANy thoughts??

Share this post


Link to post
Share on other sites



@savi14

While 1

If WinWaitActive("Window Text") then

Send("{Enter}") ;Try using ContronCommand functions instead of sending keystrokes.

else

Sleep(1000) ;Make it sleep to decrease memory usage.

Endif

Wend

;As far as it ending when you leave....if u log off or shutdown then the script will be killed automatically. If you want to kill it manually then look in the helpfile for HotKeySet.

Share this post


Link to post
Share on other sites

@savi14

While 1

If WinWaitActive("Window Text") then

Send("{Enter}") ;Try using ContronCommand functions instead of sending keystrokes.

else

Sleep(1000) ;Make it sleep to decrease memory usage.

Endif

Wend

;As far as it ending when you leave....if u log off or shutdown then the script will be killed automatically. If you want to kill it manually then look in the helpfile for HotKeySet.

Killing the script is no problem. I will leave it in the Tray and exit when I leave. I usually don't logoff as I take my laptop home with me and just leave it in standby mode.

As far as Sending the Enter keystroke, I looked into the ControlCommand and wasn't too sure on how I would use that instead of sending Enter

Share this post


Link to post
Share on other sites

@savi14

Sorry not controlcommand...try using ControlClick ( "title", "text", controlID [, button] [, clicks]] )

To get the controlID for the button you want to click, use AutoIt Window Info tool and get the "ClassNameNN" of the control.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0