Sign in to follow this  
Followers 0
PcExpert

Send Text Specified By User

3 posts in this topic

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



#2 ·  Posted (edited)

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

Thanks, it works :)

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  
Followers 0