Sign in to follow this  
Followers 0
kpt

Tricky Automate {ENTER} Window within a window

5 posts in this topic

I'm trying to automate a scan of stocks

I can't seem to get the Enter key to loop in the window I want.

It works fine in notepad but when I switch to my program it does not register.

please help. I am just trying to do a simple Enter key loop for a window within a window.

Here is the window information

Basic Window Info

Title: tradestation 9.0 - Stocks

Class: ORPLAT.EXE Tradestation

Basic Control info

Class: TSGridWndClass

Instance:2

basic code I am looking for something like

While true

Sleep(2000)

Send("{ENTER}")

Sleep(4000)

Wend

Share this post


Link to post
Share on other sites



I suspect that you need to use WinActivate before sending the Enter key to make sure the window is the active one.

If sending the Enter button doesn't work, you could try using MouseClick on the relative coordiate of the button you need to click.


#include <ByteMe.au3>

Share this post


Link to post
Share on other sites

Thanks Mass.

I have tried this:

While true

WinWaitActive("[TITLE:TradeStation 9.0 - Stocks - [scanner - G]; CLASS:TSGridWndClass; INSTANCE:2]", "")

Sleep(2000)

ControlSend("{ENTER}") ----- Also tried Send("{ENTER}")

Wend

however it still does not register the Enter in the window I want

I thought about the mouse idea but I would have to mouse click the whole screen about 400 times which would be a lot of work to make. Thought a simple Enter key would be suffice if I could just get it to register.

Any tips would be appreciated. thanks!

Share this post


Link to post
Share on other sites

Oh just to clarify. The scanner list looks like an excel spread sheet

Share this post


Link to post
Share on other sites

Nevermind. I got it. Its that darn UAC. I set it to off then restarted. works like a charm.

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