Sign in to follow this  
Followers 0
d34ddr34m3r

Weird problem with ControlSetText/ControlSend

4 posts in this topic

Hi,

I've written a script that tries to automate sending of file path strings into a Save Dialog.

$myfile="c:\somedir\somefile.someext"
controlsettext("Save As","","Edit1",$myfile)

Normally it would send the correct string into the text box but after some time (after running other apps) these happens:

1. Using ControlSetText, there would be times that the script couldn't set the text into the text box

2. So I tried using ControlSend instead

controlsend("Save As","","Edit1",$myfile)

and the following string is sent into the textbox

c;-somedir-somefile.someext
or sometimes
C:|SOMEDIR|SOMEFILE.SOMEEXT

I restart windows and ContolSetText/ControlSend already works fine. Kinda weird, does anybody know what might be the problem here?

I'm using the AutoIt 3.2.4.9.

Thanks.

Share this post


Link to post
Share on other sites



Hi,

I've written a script that tries to automate sending of file path strings into a Save Dialog.

$myfile="c:\somedir\somefile.someext"
controlsettext("Save As","","Edit1",$myfile)

Normally it would send the correct string into the text box but after some time (after running other apps) these happens:

1. Using ControlSetText, there would be times that the script couldn't set the text into the text box

2. So I tried using ControlSend instead

controlsend("Save As","","Edit1",$myfile)

and the following string is sent into the textbox

c;-somedir-somefile.someext
or sometimes
C:|SOMEDIR|SOMEFILE.SOMEEXT

I restart windows and ContolSetText/ControlSend already works fine. Kinda weird, does anybody know what might be the problem here?

I'm using the AutoIt 3.2.4.9.

Thanks.

I've never experienced the scrambled text, but the occasional "missing" where the data doesn't get set/sent at all is usually fixed by doing ControlFocus() before Send/SetText/Click/etc.

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I've never experienced the scrambled text, but the occasional "missing" where the data doesn't get set/sent at all is usually fixed by doing ControlFocus() before Send/SetText/Click/etc.

:)

I'll try that one out next time I encounter the problem again.

Thanks for the advice.

Cheers! :P

Share this post


Link to post
Share on other sites

controlsend("Save As","","Edit1",$myfile)

and the following string is sent into the textbox

c;-somedir-somefile.someext
or sometimes
C:|SOMEDIR|SOMEFILE.SOMEEXT

Thanks.

I've expereinced a similar problem on and off for some time with various versions of AutoIt3, using both Send() and ContolSend().

I've been able to minimize, but not entirely eliminate it, by checking, saving, and restoring the CapsLock state before/after the sending

(see gafrost's function http://www.autoitscript.com/forum/index.ph...ost&p=96980 for checking keystates)

Also, setting the "SendKeyDelay" option to higher numbers (so sends happen slower). Can be especially problematic if set to "0", but I've even had to make it slower/higher than the default of "5".

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