sourabh343 Posted August 11, 2016 Share Posted August 11, 2016 Hi, Can some please help me out to write a code to launh notepad and then click on Edit and then click on paste as i am new to the coding. Run("notepad.exe") Regards, Sourabh Link to comment Share on other sites More sharing options...
SadBunny Posted August 12, 2016 Share Posted August 12, 2016 Run("notepad.exe") ; <-- run notepad WinWaitActive("Untitled - Notepad") ; <-- wait until a window called "Untitled - Notepad" is active Send("^v") ; <-- send keystroke ctrl-v (much easier and faster than clicking around) That should do it. Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 12, 2016 Moderators Share Posted August 12, 2016 @sourabh343, SadBunny's solution will definitely work. As another suggestion, since it sounds like you are pasting in something you have already copied to the clipboard, perhaps something like this. It removes having to manipulate the notepad GUI: ;assumes you have already copied the lorem ipsum text to the clipboard $sMyText = ClipGet() FileWrite(@DesktopDir & "\Output.txt", $sMyText) Also, I notice you created two accounts. Please stick to the one; as you hadn't posted anything under the @sourabh moniker, I have closed that account. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
sourabh343 Posted August 12, 2016 Author Share Posted August 12, 2016 Thanks 11 hours ago, JLogan3o13 said: @sourabh343, SadBunny's solution will definitely work. As another suggestion, since it sounds like you are pasting in something you have already copied to the clipboard, perhaps something like this. It removes having to manipulate the notepad GUI: ;assumes you have already copied the lorem ipsum text to the clipboard $sMyText = ClipGet() FileWrite(@DesktopDir & "\Output.txt", $sMyText) Also, I notice you created two accounts. Please stick to the one; as you hadn't posted anything under the @sourabh moniker, I have closed that account. Hi Logan, thanks for helping me out Link to comment Share on other sites More sharing options...
sourabh343 Posted August 12, 2016 Author Share Posted August 12, 2016 13 hours ago, SadBunny said: Run("notepad.exe") ; <-- run notepad WinWaitActive("Untitled - Notepad") ; <-- wait until a window called "Untitled - Notepad" is active Send("^v") ; <-- send keystroke ctrl-v (much easier and faster than clicking around) That should do it. Thanks for helping me out Link to comment Share on other sites More sharing options...
sourabh343 Posted August 12, 2016 Author Share Posted August 12, 2016 I have one more question that is i have to write a code to launch and exe and go to tools menu and select one of the option from the menu. Could you please help me with it Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 12, 2016 Moderators Share Posted August 12, 2016 Sure, look at Run and ShellExecute in the help file, then look at WinMenuSelectItem. Try the example scripts, then try to modify them for your needs. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
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