Jump to content

How to rite a code to launch notepad and the click on Edit and then again click on paste


Recommended Posts

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 post
Share on other sites
  • Moderators

@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 post
Share on other sites

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 post
Share on other sites
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 post
Share on other sites
  • Moderators

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 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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...