Jump to content
Sign in to follow this  
mohenly

Faster way to "print" a variable than SEND?

Recommended Posts

mohenly

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
SlimShady

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
mohenly

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
trids

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
zcoacoaz

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
Blue_Drache

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  

×