Jump to content
Sign in to follow this  
gagaga

ControlSend problem

Recommended Posts

gagaga

Hi, I was wondering why controlsend doesnt work in my script:

$Wait = 400

AutoItSetOption("WinTitleMatchMode", 4)

$Win_Title = "WordPad"

$Win_Text = ""

$Control_ID = "59648"

Sleep($Wait)

ShellExecute("webproxies.txt")

WinWaitActive("WordPad")

$variable = "http://www."

$variable2 = "{DOWN}"

$variable3 = "{HOME}"

$x = 0

do

ControlSend($Win_Title, $Win_Text, $Control_ID, $variable)

Sleep($Wait)

ControlSend($Win_Title, $Win_Text, $Control_ID, $variable2)

Sleep($Wait)

ControlSend($Win_Title, $Win_Text, $Control_ID, $variable3)

$x += 1

until $x = 5

Im new to autoit , tried to search for answer but couldnt find

thanks,

Edited by gagaga

Share this post


Link to post
Share on other sites
Pain

This works for me.

AutoItSetOption("WinTitleMatchMode", 2)
ControlSend("WordPad", "", "RICHEDIT50W1", "hello world")

Share this post


Link to post
Share on other sites
oMBRa

just replace this:

$Control_ID = "59648"

with:

$Control_ID = 59648
Edited by oMBra

Share this post


Link to post
Share on other sites
gagaga

Thanks, but those didnt work.

any help?

Share this post


Link to post
Share on other sites
oMBRa

do u get any errors??

btw I post the code with the replacement:

$Wait = 400
AutoItSetOption("WinTitleMatchMode", 4)

$Win_Title = "[Class:WordPadClass]"
$Win_Text = ""
$Control_ID = 59648
Sleep($Wait)
;ShellExecute("webproxies.txt")
WinWaitActive($Win_Title)
$variable = "http://www."
$variable2 = "{DOWN}"
$variable3 = "{HOME}"
$x = 0

do
ControlSend($Win_Title, $Win_Text, $Control_ID, $variable)
Sleep($Wait)
ControlSend($Win_Title, $Win_Text, $Control_ID, $variable2)
Sleep($Wait)
ControlSend($Win_Title, $Win_Text, $Control_ID, $variable3)
$x += 1
until $x = 5

Share this post


Link to post
Share on other sites
Bowmore

Thanks, but those didnt work.

any help?

Another variation that should work for you.

$Wait = 400

AutoItSetOption("WinTitleMatchMode", 4)

$Win_Title = "[REGEXPTITLE:WordPad]"
$Win_Text = ""
$Control_ID = 59648

Sleep($Wait)

ShellExecute("webproxies.txt")

WinWait($Win_Title)
If Not WinActivate($Win_Title) Then WinActivate($Win_Title)
WinWaitActive($Win_Title)

$variable = "http://www."
$variable2 = "{DOWN}"
$variable3 = "{HOME}"
$x = 0

do
ControlSend($Win_Title, $Win_Text, $Control_ID, $variable)
Sleep($Wait)
ControlSend($Win_Title, $Win_Text, $Control_ID, $variable2)
Sleep($Wait)
ControlSend($Win_Title, $Win_Text, $Control_ID, $variable3)
$x += 1
until $x = 5

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites
JReinn

I also have this problem, but none of these codes work for me :mellow:..

(I actually want it to say something in Warcraft 3 (The window is named "Warcraft III")) Any help ?

Share this post


Link to post
Share on other sites
oMBRa

you are lucky... I play warcraft III to... tell me your account and server and we can talk directly

Share this post


Link to post
Share on other sites
JReinn

you are lucky... I play warcraft III to... tell me your account and server and we can talk directly

WinneR_DK on northrend, but I think it would be easier to do it on MSN, jan@pixiehouse.com :mellow:

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  

×