Jump to content

how to send text?


 Share

Recommended Posts

hello im trying to automate random greetings word from .txt file  and write/send some strings but it gives me error

please be gentle to me im kinda newbie thank you

$File = FileReadToArray("words.txt")
$RandomWords = $File[Random(0, UBound($File) - 1, 1)]

send ("$RandomWords")
sleep (1000)
send ("{enter}")


 

Edited by darkangel37
Link to comment
Share on other sites

  • Moderators

@darkangel37, remove the quotes in your send line. When referencing a variable, do not put quotes around it.

"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 comment
Share on other sites

Okay so here's an idea, because currently as soon as you launch the application, the text will be sent.

Press the + key (not numpad) to send to current active window

HotKeySet("{+}", "_Send")

$File = FileReadToArray("words.txt")

While 1
    Sleep(10)
WEnd

Func _Send()
    $RandomWords = $File[Random(0, UBound($File) - 1, 1)]
    Send($RandomWords)
EndFunc

Just close the application by clicking the tray icon and choosing exit

Link to comment
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
 Share

×
×
  • Create New...