Jump to content
Sign in to follow this  
PcExpert

Send Text Specified By User

Recommended Posts

Hello,

I woul'd like to make a script that ask the user to put in some text and then type it in, for example notepad. I had a code but it didn't work. This is it:

$text = InputBox ("test", "type the text that should be send to notepad")

MsgBox(64, "TEST", "This is a test")

Sleep(5000)

Send("$text")

Send("{ENTER}")

Sleep(5000)

Kind Regards,

PcExpert

Share this post


Link to post
Share on other sites

I don't see any notepad window in your script so added some code to test with.

$text = InputBox ("test", "type the text that should be send to notepad")
MsgBox(64, "TEST", "This is a test")
;~ Sleep(5000)
;-------------------------------
If Not WinExists('Untitled') Then
    Run('notepad')
    WinWaitActive('Untitled')
EndIf
;--------------------------------
Send($text)
Send("{ENTER}")
Sleep(5000)

Notice that $test has no quotes around it.

Edited by MHz

Share this post


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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...