Jump to content

Recommended Posts

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
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
Posted

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!
Posted

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.

Posted

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]

Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...