Jump to content

Recommended Posts

Posted

That depends on what exactly you are trying to do.

Here's an example of an alternative way:

$text="This is a pretty long text that should appear in notepad really fast"
Run("notepad.exe")
WinWait("[Class:Notepad]")
ControlSetText("[Class:Notepad]","","[CLASS:Edit; INSTANCE:1]",$text)
Posted

  dgarrett8 said:

You personally think it's? I think it's fast as hell.

I think so too, but he wants the text to "appear" just like it does when you paste text on an editor.

Posted (edited)
  dgarrett8 said:

I don't think that is possible..maybe I'm wrong

Click me Edited by Nahuel
Posted

AutoItSetOption("SendKeyDelay", 1)

AutoItSetOption("SendKeyDownDelay", 1)

~~--Feel Free to Steal my Sigs --~~FLAT LOOK____________________________________ROUNDED LOOK

Posted

  oMBra said:

... I want a speed like when u do Ctrl + V to paste some text

The sample code posted by Nahuel should work for you unless your app (like some apps I work with) ignores* ControlSetText. In that case, use ClipPut("text") and ControlSend("^v") [or if you must - just use Send("^v")]

ClipPut("This is a pretty long text that should appear in notepad really fast")
Run("notepad.exe")
WinWait("[Class:Notepad]")
ControlSend("[Class:Notepad]","","[CLASS:Edit; INSTANCE:1]", "^v")
Sleep(1500)
WinClose("[Class:Notepad]")oÝ÷ ØKÞÚ-z  è­ë-ë^ÆÛ§¶)r¢ë½ëayø¥xò¢èî²×%¢Ç­ì"Ú06^¥§pYg¢Úk¢jmÊ­¢Æ¯y©òµìmªê-±éíªê-¶­¾&¢{k¢Tµ7±µ«­¢+ØÀÌØíÑáÐôÅÕ½ÐíQ¡¥Ì¥ÌÁÉÑÑä±½¹ÑáÐÑ¡ÐÍ¡½Õ±ÁÁÈ¥¸¹½ÑÁɱ±äÍÐÅÕ½Ðì)IÕ¸ ÅÕ½Ðí¹½ÑÁ¹áÅÕ½Ðì¤)]¥¹]¥Ð ÅÕ½Ðím
±ÍÌé9½ÑÁtÅÕ½Ðì¤)
½¹Ñɽ±MÑQáÐ ÅÕ½Ðím
±ÍÌé9½ÑÁtÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðím
1MLé¥Ðì%9MQ9
èÅtÅÕ½Ðì°ÀÌØíÑáФ)M±À ÄÔÀÀ¤)]¥¹
±½Í ÅÕ½Ðím
±ÍÌé9½ÑÁtÅÕ½Ðì

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted

  burners said:

AutoItSetOption("SendKeyDelay", 1)

AutoItSetOption("SendKeyDownDelay", 1)

Welcome to the forum.

It would depend on the volume of data being sent as to the speed delta between the fastest Send and the other methods. Try this code.

AutoItSetOption("SendKeyDelay", 1)
AutoItSetOption("SendKeyDownDelay", 1)

Dim $t
For $i = 1 To 500
    $t &= String($i)
Next

Run("notepad.exe")
WinWait("[Class:Notepad]")
Send("Send  " & $t)
Sleep(1000)
ControlSend("[Class:Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "^a{BS}")
Sleep(1000)

ClipPut($t)
Sleep(50)
ControlSend("[Class:Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "Paste  " & "^v")
Sleep(2000)
ControlSend("[Class:Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "^a{BS}")
Sleep(1000)

ControlSetText("[Class:Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "ControlSetText  " & $t)
Sleep(2000)
WinClose("[Class:Notepad]")

@oMBra,

You can overwhelm the Windows clipboard if you repeatedly transfer data to and from it as fast as AutoIt can. The OS clipboard may fail you at max speed... It would be best to use a Sleep of about 50 or a 100 ms between each repeated clipboard operation.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted

I already use clipboard but some letter can't be copied like "" and I cant use ControlSetText because the window isnt a windows application so I cant get the ID of the control

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