Jump to content

Paste text instantly


Recommended Posts

Here is some code:

#include <INet.au3>
Send (_INetGetSource ("www.google.com"))

When I use the function send, it's writing the text slowly. The problem is that the source of many sites is long. Which function should I use in order to paste the text instantly?

I tried to use the macro copy+paste, but this macro doesn't work on my computer.

Edited by Vladi243
Link to comment
Share on other sites

Here is some code:

#include <INet.au3>
Send (_INetGetSource ("www.google.com"))

When I use the function send, it's writing the text slowly. The problem is that the source of many sites is long. Which function should I use in order to paste the text instantly?

I tried to use the macro copy+paste, but this macro doesn't work on my computer.

Where you want to put the text? Edited by Andreik

When the words fail... music speaks.

Link to comment
Share on other sites

In notepad... but I can write a script to open the notepad later.

So the text is on the internet and you need it to write what it says into notepad?

Once you've answered that I'll try to help you more.

For now though here is a script to open a notepad document.

Run("notepad.exe C:\Documents and Settings\Name\Desktop\Folder\File Name.txt")

Just replace "C:\Documents and Settings\Name\Desktop\Folder\File Name.txt" with the location\name.txt of the notepad document.

Link to comment
Share on other sites

ClipPut then ClipGet. Im sure thats much faster if not instantly.

Edit: Had a wrong letter inn there.

Edited by jokke
UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

ClipPut then ClipGet. Im sure thats much faster if not instantly.

Edit: Had a wrong letter inn there.

I know that I can use these functions, but I don't know how to paste the text from the clipboard.

I tried to paste with send (^v), but it doesn't work.

Link to comment
Share on other sites

ClipPut then ClipGet. Im sure thats much faster if not instantly.

Edit: Had a wrong letter inn there.

With ClipGet you can't set the text in notepad, only retrieves text from the clipboard.

When the words fail... music speaks.

Link to comment
Share on other sites

I know this... I need to know how to put it in the notepad.

Any ideas?

#include <INet.au3>
Clipput(_INetGetSource ("www.google.com"))
run('Notepad.exe ')
winwaitactive("Untitled")
Send("^v")
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.
Link to comment
Share on other sites

#include <INet.au3>

ClipPut(_INetGetSource("http://www.google.co.uk")); Source of Google to clipboard

If Not ProcessExists("notepad.exe") Then
    Run("notepad.exe"); Run notepad
    WinWaitActive("Untitled - Notepad"); Wait till window is active
    ControlSend("Untitled", "", "Edit1", ClipGet())
    MsgBox(0, "Done!", "Command completed!")
EndIf

Link to comment
Share on other sites

#include <INet.au3>

ClipPut(_INetGetSource("http://www.google.co.uk")); Source of Google to clipboard

If Not ProcessExists("notepad.exe") Then
    Run("notepad.exe"); Run notepad
    WinWaitActive("Untitled - Notepad"); Wait till window is active
    ControlSend("Untitled", "", "Edit1", ClipGet())
    MsgBox(0, "Done!", "Command completed!")
EndIf
I think the Run statement should be on the same line as the If, and then remove the EndIf at the end.

ControlSend is very very slow. Send("^v") is more than 1000 times faster when I compared them. Also, controlsend causes problems with some of the text and it is not inserted correctly.

Try comparing your method with the one I posted. (Mine could do with your If Not ... line though.)

Edited by martin
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.
Link to comment
Share on other sites

Seems like everyone goes offtopic,...

No, I don't see how you are right about that. The OP wanted a fast method and he found one.

Setting the delays as you suggest will make Send faster, but still nowhere near as fast as Ctrl V, and, as I pointed out in one of my 'offtopic posts', using send causes problems. Reducing the delays can often cause even more problems. I have seen quite a few post where people have had problems using Send and which have been solved by increasing the delays. Did you try what you suggested? If so did you notice any problems?

Did you try any of the other solutions posted as a comparison?

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.
Link to comment
Share on other sites

Sorry if I offended you, I didn't meant to.

His question was why the Send command was slow, but yes I do agree that your method is better then mine and more reliable.

I've tried my solution in some of my script and also found other that use the same method without any problem this far.

Link to comment
Share on other sites

  • Moderators

#include <INet.au3>
$s_file_name = "google_output.txt"
FileClose(FileOpen($s_file_name, 2))
FileWrite($s_file_name, _INetGetSource("www.google.com"))
ShellExecute($s_file_name)
Faster?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

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