Jump to content

Recommended Posts

Posted

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

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

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