sree161 Posted July 18, 2017 Posted July 18, 2017 Hi all, I am new here and i am searching for some command or script which can copy text on clip board to note pad without opening it (i am planning to copy by just clicking on notepad). Can u help on the same by giving me some idea. Thanks in advance, Sree161.
xcaliber13 Posted July 18, 2017 Posted July 18, 2017 I don't know about not opening notepad. But here is what I use to copy from clipboard to notepad: #include <Date.au3> #include <file.au3> Run('"C:\Windows\System32\notepad.exe"') Sleep (4000) WinActive("Untitled - Notepad") Send("!EP") Sleep (8000) Send("!FA") Sleep (2000) WinActive("Save As") Send("YourPath_and_FileName.txt") Sleep (2000) ControlClick("Save As", "", "&Save", "Left") Sleep (3000) ProcessClose('notepad.exe') I use this coding daily. Works great for my needs. Some others most likely will have a better solution.
sree161 Posted July 18, 2017 Author Posted July 18, 2017 Thanks for the help..but i want to copy it to a existing notepad....i changed some part of the scripts and script seems to be ok...but i am looking for better solutions.
InunoTaishou Posted July 18, 2017 Posted July 18, 2017 Confused, you want to copy the clipboard to the notepad that's already open? Use ControlSetText. The example for ControlSetText does exactly what you want, just take out the Run("notepad.exe")
BrunoJ Posted July 18, 2017 Posted July 18, 2017 6 minutes ago, InunoTaishou said: Confused, you want to copy the clipboard to the notepad that's already open? Use ControlSetText. The example for ControlSetText does exactly what you want, just take out the Run("notepad.exe") Exactly what I was going to suggest. It's like the example was made to order.
junkew Posted July 19, 2017 Posted July 19, 2017 define better solution? Not opening clipboard? not opening notepad? not opening both? https://www.autoitscript.com/autoit3/docs/functions/ClipPut.htm https://www.autoitscript.com/autoit3/docs/functions/ClipGet.htm https://www.autoitscript.com/autoit3/docs/functions/HotKeySet.htm https://www.autoitscript.com/wiki/FAQ#How_can_I_control_.28click.2C_edit_etc.29_an_external_.28html.29_application.3F FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
sree161 Posted July 20, 2017 Author Posted July 20, 2017 Hi all, I just wanted to copy text from command prompt to note pad (which is already created on desktop) without opening note pad. i mean to say i want to copy text which is in clip board just by selecting the targeted notepad. If i select it should paste text automatically into that notepad.
junkew Posted July 20, 2017 Posted July 20, 2017 What do you want to copy from command prompt. Commands can sent their output directly to a txt file on your desktop. Then when you doubleclick it will open in notepad. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
nitekram Posted July 20, 2017 Posted July 20, 2017 10 hours ago, sree161 said: Hi all, I just wanted to copy text from command prompt to note pad (which is already created on desktop) without opening note pad. i mean to say i want to copy text which is in clip board just by selecting the targeted notepad. If i select it should paste text automatically into that notepad. Create a hotkey, set it to copy text, then have it append to your text file. sree161 1 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
sree161 Posted August 5, 2017 Author Posted August 5, 2017 On 7/21/2017 at 2:49 AM, nitekram said: Create a hotkey, set it to copy text, then have it append to your text file. created hotkey and it worked fine....thanks for ur help
n3wbie Posted August 5, 2017 Posted August 5, 2017 try this $tempvar="" do $a=ClipGet() if $a<>$tempvar Then FileWrite("log.txt",$a&@CRLF) $tempvar=$a EndIf sleep(500) until 1=0
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