Sign in to follow this  
Followers 0
darkangel37

how to send text?

6 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



where is your desired target for the text to be sent to?

Share this post


Link to post
Share on other sites
15 hours ago, genius257 said:

where is your desired target for the text to be sent to?

for emails word.txt file contain some hello,hi, dear. and bunch of shortcut greetings

Share this post


Link to post
Share on other sites
15 hours ago, JLogan3o13 said:

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

what should i put? sorry im kinda newbie here

Share this post


Link to post
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

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

  • Similar Content

    • caramen
      By caramen
      Hello guys.
      I have got this script
      $iPid = run("Powershell Get-ADUser "&$UserNameReaded&" -Properties * | select -Expand EmailAddress" , @WindowsDir , @SW_HIDE , 0x2) $MailUser = "" While 1 $MailUser &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd GUICtrlSetData ($Label015, ""&$MailUser) If $MailUser = "" Then GUICtrlSetData ($Label017 , "N/A"&$MailUser) Everything is working fine i got correct value
      For my account the value is for exemple :
      J.Personnal@Enterprise.com in the $Label017 the value is correct i have still
      J.Personnal@Enterprise.com If i use :
      Send (""&$MailUser) i have now :
      J.Personnalnterprise.com Is there a way to correct this ?
    • OrangeCoder
      By OrangeCoder
      Hey Guys - I am trying to write a very simple script that just types a value into ONE field and presses and next
      That's it!
      Here is what I am trying to do:
      I have a software product that used Installshield to package it - I wrote a response file per installshield directions /  for the software and it automated almost everything except one window... sadly the company that makes the software doesn't want to help, installshield won't help since I don't have a license . So I am trying to write and autoit script to fill in the one window that doesn't get recorded in the response file to finish the installation
      My write activated the window but when I follow it with a send() it doesn't work
       
      here is what I have
      WinActivate("Server Information") Send("xx-xxx-xx") Send("!n") Send("{SPACE}") any ideas ?
    • NiceBoy1234
      By NiceBoy1234
      How can I run this command:
       
           Send( 'C:\xampp\htdocs\myApp\BuildDVD.exe ..\..\projects\dvdrom\' & $sFileName & '\project.xml ..\..\projects\' & $sFileName & '\video')

      in a Shell Execute?

      I can run
      ShellExecute('C:\xampp\htdocs\myApp\BuildDVD.exe')

      but how to I add the rest of the command?
    • WoodGrain
      By WoodGrain
      Hi All,
      Could someone please PLEASE tell me what I'm doing wrong here?
      I feel like I'm close to figuring this out, I think I've identified what is causing the issue.
      Whenever I try to use the hotkey CTRL+SHIFT+T (or any other letter other than T for that matter) to paste the text to notepad, my CTRL and SHIFT keys are held down *IF* I release them *WHILE* the raw text is being written.
      It seems to be that if I release the CTRL+SHIFT keys:
      Before the Send Raw text starts to write to the screen: the CTRL and SHIFT keys ARE NOT held down, this is good During the Send Raw text being written to the screen: the CTRL and SHIFT keys ARE held down perpetually until I physically press them on the keyboard, this is bad After the Send Raw text has written all text to the screen: the CTRL and SHIFT keys ARE NOT held down, this is good This is also the case if I were to use the Windows Key as the hot key instead of the CTRL+SHIFT, I would need to tap the WIN key physically on my keyboard if I released it while the raw tet was being sent to the screen (eg, WIN+T).
      This issue also happens no matter which program I try to write the text to.
      Here's some example code:
      (I've put a bunch of "a's" in there to give enough time to test releasing the CTRL+SHIFT before/during/after the writing of them)
      HotKeySet("^+t", "WriteTxt") Func WriteTxt() WinWaitActive("Untitled - Notepad") $var = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" send($var, 1) EndFunc While 1 Sleep(500) WEnd Thanks guys!
    • JJ1122
      By JJ1122
      #include <Misc.au3>
      While 1
         If _IsPressed(59) Then
            Send("{B}")
            MouseDown("left")
         Else
            Send("{B}")
            MouseUp("left")
         EndIf
      WEnd
       
      I want the script to do this:
      - if I press "Y", send "B" once and hold left click down until i release "Y".
      - if I take my hands off of "Y" key, then send "B" once again and release left click.
       
      but the script I made has problems.
      when I run the script, it starts sending "B" repeatedly, and my left click won't work.
       
      I'm not smart enough to figure out what the problem is... please help me!
      sorry for bad English.