Jump to content
Sign in to follow this  
Vladi243

Paste text instantly

Recommended Posts

Vladi243

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

Share this post


Link to post
Share on other sites
Andreik

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

Share this post


Link to post
Share on other sites
Vladi243

Where you want to put the text?

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

Share this post


Link to post
Share on other sites
SwordHunter4Ever

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.

Share this post


Link to post
Share on other sites
Vladi243

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

Yes.

Share this post


Link to post
Share on other sites
jokke

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.

Share this post


Link to post
Share on other sites
Vladi243

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.

Share this post


Link to post
Share on other sites
Andreik

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

Share this post


Link to post
Share on other sites
Vladi243

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

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

Any ideas?

Share this post


Link to post
Share on other sites
BrettF
martin

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.

Share this post


Link to post
Share on other sites
James

#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

Share this post


Link to post
Share on other sites
martin

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

Share this post


Link to post
Share on other sites
Vladi243

#include <INet.au3>
Clipput(_INetGetSource ("www.google.com"))
run('Notepad.exe ')
winwaitactive("Untitled")
Send("^v")
Thanks it's working great!

Share this post


Link to post
Share on other sites
2words4uready

Thanks it's working great!

Why not a website input box?

#include <INet.au3>
$name = InputBox("Website", "Websites Name:")
Clipput(_INetGetSource ($name))
run('Notepad.exe ')
winwaitactive("Untitled")
Send("^v")

READ BEFORE POSTINGMy UDF'sMessagesYou say plz because its shorter than please. I say no because its shorter than yes.Join My Website

Share this post


Link to post
Share on other sites
Pain

Seems like everyone goes offtopic, see if this works

Opt("SendKeyDelay", 0)

Opt("SendKeyDownDelay", 0)

Share this post


Link to post
Share on other sites
martin

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.

Share this post


Link to post
Share on other sites
Pain

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.

Share this post


Link to post
Share on other sites
SmOke_N

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

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  

×