-1

So i have been working on a troll terminal and now i want to type out the entire bee movie script or whatever i put in a text file. What i need help with is taking the text(with enters and spaces) and fully typing it out. Another way to say it is i want to take a text file and copy it threw typing it out. I couldnt find any decent code to do this wich is why i'm asking here.

Also if possible make it type anything that you put in the text file. (I have no clue why it doesnt let me post this)

Idea: I might know another way around but i dont know how to get it done. Maby there is a way to infinetly generate variables for each line and type them out like that.

Other idea: I might be able to make a tool to let me quickly hard code it.

10 Rep
  • 2,217
  • 7
  • 19
  • 33
smvd
  • 117
  • 2
  • 11
  • Fixed why it didnt let me post. – smvd Dec 06 '20 at 18:58
  • No, i m looking for multi line. Still thanks tho. – smvd Dec 07 '20 at 07:23
  • 1
    @smvd Have you checked the answer to that question or you've just read the question header? It contains the solution. – astentx Dec 07 '20 at 08:52
  • It contains most of the solution i need but my respons was incorrect cuz me during class not have big brain. I understand how to type the thing i need help with is taking a text file for example the entire urban dictionary and setting to a string that the send key command will properly translate – smvd Dec 07 '20 at 09:49
  • @eyllanesc i m so sorry i did a smol brain and made a huge mistake please excuse me for not being smart. Your actual edit was fully correct. (I will delete any comment i made that included the mistake exept this one) – smvd Jan 05 '21 at 21:53

2 Answers2

0
    Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile("C:\yourfirstfile", 1)
content = file.ReadAll

Const fsoForAppend = 8

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")

'Open the text file
Dim objTextStream
Set objTextStream = objFSO.OpenTextFile("C:\yoursecondfile", fsoForAppend)

'Display the contents of the text file
objTextStream.WriteLine content 


'Close the file and clean up
objTextStream.Close
Set objTextStream = Nothing
Set objFSO = Nothing

Set wshShell = CreateObject("Wscript.Shell")
wshShell.run "C:\yoursecondfile"

Tell me if it works

coder9927
  • 180
  • 12
0

Yes i m self anwsering.

This script works but it double taps enter i will update it if i figure out how to stop that from happening.

Set wsh=WScript.CreateObject("WScript.Shell")
sub custom_text_typer_confirm
Set objFileToRead =WScript.CreateObject("Scripting.FileSystemObject").OpenTextFile("Custom_Text_Typer.txt",1)
strFileText = objFileToRead.ReadAll()
objFileToRead.Close
custom_typer_wait = inputbox("How long should the program wait untill it will start typing?", "Eclips-Terminal Custom Text Typer")
custom_typer_wait1=custom_typer_wait * 1000
Wscript.sleep custom_typer_wait1
wsh.sendkeys (strFileText & "{enter}")
Wscript.sleep 1000
call home
end sub
smvd
  • 117
  • 2
  • 11