Jump to content

ControlSend problem


gagaga
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...