Jump to content
Sign in to follow this  
darylb

Wait for paste in program

Recommended Posts

darylb

I have a program that that copies a range from excel and pastes it in a program our company has. How can I have AutoIt wait for windows to finishing its paste operation before continuing? Sometimes this paste takes 1 second and sometime it'll take 5-6 seconds. If i'm performing this operation hundreds or thousands of times, its much longer to take the safe route and pause for 7-8 seconds during every iteration.

I'm using

send("{ctrldown}v{ctrlup}")
To paste

Share this post


Link to post
Share on other sites
PhilRip

what about a !v (ctrl-v) hotkey?

Share this post


Link to post
Share on other sites
darylb

I dont have trouble using the paste function. I just need a way for my macro to wait for the paste to finish. Some type of wait function?

Share this post


Link to post
Share on other sites
martin

I have a program that that copies a range from excel and pastes it in a program our company has. How can I have AutoIt wait for windows to finishing its paste operation before continuing? Sometimes this paste takes 1 second and sometime it'll take 5-6 seconds. If i'm performing this operation hundreds or thousands of times, its much longer to take the safe route and pause for 7-8 seconds during every iteration.

I'm using

send("{ctrldown}v{ctrlup}")
To paste
Maybe you could send something like a tab or a shortcut after you have sent ^v to set the focus in the application to some other control than the one you are pasting into. I assume (means I don't know) that the focus won't change until the pasting is complete. You can then get the focused control using a loop with ControlGetFocus and when it is the one you set the focus to the pasting has finished.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
Valuater

try and use ControlCommand()'s

Get the comtrol info from Autoit Window Info Tool

Start > Program Files > Autoit > Autoit Window Info Tool

I would try ControlSetText() it's almost Instantaneous

See help!

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
darylb

try and use ControlCommand()'s

Get the comtrol info from Autoit Window Info Tool

Start > Program Files > Autoit > Autoit Window Info Tool

I would try ControlSetText() it's almost Instantaneous

See help!

8)

The only problem I worry about with this is that i'm not pasting a string of text but a copied range from excel

Share this post


Link to post
Share on other sites
PsaltyDS

The only problem I worry about with this is that i'm not pasting a string of text but a copied range from excel

When you are doing it manually, how do you know the paste is done? What about the operation tells you it's done when you are actually at the keyboard doing it?

:D


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
Valuater

The only problem I worry about with this is that i'm not pasting a string of text but a copied range from excel

ControlSetText(.... ClipPut() )

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Teltech

sleep(100)

??? Although I'm not sure this is what you really want, why does it take so long? resources boggin down, switching between the two programs take time?

Try to look up these functions in the help.

Winwait

Winactivate

etc...

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  

×