Sign in to follow this  
Followers 0
mohenly

Faster way to "print" a variable than SEND?

7 posts in this topic

#1 ·  Posted (edited)

I'm a couple of hours into using AutoIt so, bearing that in mind...

When I use the Send($string, 1) command to put the contents of a string variable into a form, it's doing so one character at a time, as though it was being entered with a keyboard.

Is there a faster way to do this -- i.e., to enter the entire string in one go?

Thanks.

Edited by mohenly

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This is the fastest way.

$var = "Some text you want to send..."
$backup = ClipGet()  ;save previous content of clipboard
ClipPut($var)    ;Put contents of variable in the clipboard
Send("^v")  ;Send Ctrl+V
Edited by SlimShady

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

could also try to set the following to see if that helps (default=5):

Opt("SendKeyDelay", 1)
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

This is the fastest way.

$var = "Some text you want to send..."
$backup = ClipGet() ;save previous content of clipboard
ClipPut($var)   ;Put contents of variable in the clipboard
Send("^v") ;Send Ctrl+V

<{POST_SNAPBACK}>

Thanks Slim (and JdeB). That makes all the difference!

Share this post


Link to post
Share on other sites

Depending on the destination of your text, you can also use ControlSetText() .. the helpfile has a good example of how to use it with notepad.

Share this post


Link to post
Share on other sites

if you use the clipget stuff you can mess up the users clip board if they have somthing important in it


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites

if you use the clipget stuff you can mess up the users clip board if they have somthing important in it

<{POST_SNAPBACK}>

; Program Start
$prevclip = Clipget()
While 1
   Sleep (10)
Wend
ClipPut($prevclip)
Exit
; Program End

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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