Jump to content
Sign in to follow this  
Fulano

Help with Send[Solved]

Recommended Posts

Fulano

I'm trying to automate some very, very tedious data entry. The issue that I'm running into is that AutoIt manages it's Send() and ControlSend() in a very asynchronous manner.

In this case it is a problem with this code

Send ($noteText, 1)
    
    Sleep (2000) ; Horrible, laggy work around :(

    ControlSend ("Insert Note", "", "[NAME:detailsTextBox]", "{ESC}") ;Closes the Window
    Sleep (20)
    Send ("{Enter}")

Where the second part executes before the Send is finished. I do this upwards of 100 times a day, so a 2 second lag gets very, very obnoxious.

Does anyone have any suggestions about how I could test to see if Send() was finished, or calculate how long it will take ahead of time?

Any tips would be greatly appreciated.

Edited by Fulano

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Share this post


Link to post
Share on other sites
Yoriz

Its difficult to say from the information given, but the first send must cause something to happen , like a window closing or something ? what ever its reaction to your send is you could check that the reaction has occured before your continue.


GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

Share this post


Link to post
Share on other sites
Fulano

Its difficult to say from the information given, but the first send must cause something to happen , like a window closing or something ? what ever its reaction to your send is you could check that the reaction has occured before your continue.

Thank you for taking interest Yoriz, and you're right, I should have explained better.

The first bit sends text to a window, I would send it directly to control, but ACT! appears to randomize it's control names or uses non-standard controls or somehow borks things up, because I am unable to grab data from them (or send it for that matter) - and believe me, I've tried, the workarounds I've had to use to get any information from this program are nasty.

Because the text changes depending on the record that I am reading in, there isn't any way that I can do pixel tests to check to make sure it's finished. :mellow:

The problem is happening when the second segment sends it's data first, closing the window that I am trying to put text into and selecting a random field in the main contact window. Like I said, Sage put some work into making ACT! unautomatable.


#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Share this post


Link to post
Share on other sites
Yoriz

Ok :mellow: , so the reaction to your ControlSend is that it contains the text you sent in $noteText, are you able to read the text in the window with WinGetText() and not carry on till you confirm it has the $noteText you sent to it ?


GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

Share this post


Link to post
Share on other sites
Fulano

Holy Smokes! I didn't even think to try and grab the text from the window itself Posted Image. Bravo!

EDIT: Tried it, works like a charm :mellow:

Edited by Fulano

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

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  

×