Jacob_DiDiodato

Auto Program Writer

Feb 23rd, 2017
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.29 KB | None | 0 0
  1. ;Project Name: autoProgramWriter.au3
  2. ;Author Name: Jacob DiDiodato
  3. ;Project Version: 1.0
  4. ;Last Edit: Thursday February 23rd 2017 @ 8:11 PM
  5. ;This program, when given a filename, will write all the characters of that file to notepad++ save for extra new lines. MAKE SURE THAT WHEN USING THIS PROGRAM THAT AUTO-INDENTING ON NOTEPAD++ IS DISABLED.
  6. ;To disable auto-indenting do the following Settings -> Preferences -> http://www.filedropper.com/pdndisableauto-indent
  7.  
  8. #include <MsgBoxConstants.au3>
  9. #include <AutoItConstants.au3>
  10.  
  11. $fileName = InputBox("filename", "Enter the filename to type")
  12. $file = FileOpen($fileName)
  13. $readFile = FileRead($file)
  14.  
  15. ;MsgBox(0, "text", $readFile)
  16.  
  17. ;Split the entire file into single characters
  18. $chars = StringSplit($readFile, "")
  19.  
  20. ;Run notepad - if you don't have it it could be a problem
  21. Run("C:\Program Files (x86)\Notepad++\notepad++.exe")
  22.  
  23. WinWaitActive("[CLASS:Notepad++]", "", 10)
  24.  
  25. ;Write all the characters to notepad++
  26. For $i = 1 To $chars[0]
  27.    If $chars[$i] == Chr(9) Then
  28.       Send("{TAB}")
  29.    ElseIf $chars[$i] == Chr(10) Then
  30.       ;Send("{ENTER}")
  31.    Else
  32.       Send($chars[$i], 1)
  33.    EndIf
  34.    ;Edit this if you want it to write faster or slower. Smaller numbers make it faster and larger numbers make it slower
  35.    Sleep(10)
  36. Next
  37.  
  38. FileClose($file)
Advertisement