Vladi243 Posted July 27, 2008 Posted July 27, 2008 (edited) 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 July 27, 2008 by Vladi243
Andreik Posted July 27, 2008 Posted July 27, 2008 (edited) 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 July 27, 2008 by Andreik
Vladi243 Posted July 27, 2008 Author Posted July 27, 2008 Where you want to put the text?In notepad... but I can write a script to open the notepad later.
SwordHunter4Ever Posted July 27, 2008 Posted July 27, 2008 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.
Vladi243 Posted July 27, 2008 Author Posted July 27, 2008 So the text is on the internet and you need it to write what it says into notepad?Yes.
jokke Posted July 27, 2008 Posted July 27, 2008 (edited) ClipPut then ClipGet. Im sure thats much faster if not instantly.Edit: Had a wrong letter inn there. Edited July 27, 2008 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.
Vladi243 Posted July 27, 2008 Author Posted July 27, 2008 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.
Andreik Posted July 27, 2008 Posted July 27, 2008 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.
Vladi243 Posted July 27, 2008 Author Posted July 27, 2008 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?
BrettF Posted July 27, 2008 Posted July 27, 2008 ControlSend("Untitled", "", "Edit1", "This is a line of text in the notepad window") Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
martin Posted July 27, 2008 Posted July 27, 2008 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.
James Posted July 27, 2008 Posted July 27, 2008 #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 Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
martin Posted July 27, 2008 Posted July 27, 2008 (edited) #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!") EndIfI 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 July 27, 2008 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.
Vladi243 Posted July 27, 2008 Author Posted July 27, 2008 #include <INet.au3> Clipput(_INetGetSource ("www.google.com")) run('Notepad.exe ') winwaitactive("Untitled") Send("^v")Thanks it's working great!
2words4uready Posted July 27, 2008 Posted July 27, 2008 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")
Pain Posted July 27, 2008 Posted July 27, 2008 Seems like everyone goes offtopic, see if this works Opt("SendKeyDelay", 0) Opt("SendKeyDownDelay", 0)
martin Posted July 27, 2008 Posted July 27, 2008 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.
Pain Posted July 27, 2008 Posted July 27, 2008 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.
Moderators SmOke_N Posted July 27, 2008 Moderators Posted July 27, 2008 #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.
Vladi243 Posted July 29, 2008 Author Posted July 29, 2008 #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?It's much more faster Thank you very much... you helped me a lot.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now