Jump to content

Recommended Posts

Posted

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

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

  • Moderators
Posted

@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!

Posted

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

Posted
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

Posted

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

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