Hunter Posted November 5, 2008 Posted November 5, 2008 I'm trying to make it Open Note Pad Type text and then Save. I'm stuck at the Save part. It goes in and types the text that I want it to save as. But it won't "click" the save button. I need the code for it. Heres the script. Quote $answer = MsgBox(4, "Pwnage Notepad", "This script will run Notepad type in some text and then quit. Run?")If $answer = 7 Then MsgBox(0, "AutoIt", "OK. Bye!") ExitEndIfRun("notepad.exe")WinWaitActive("Untitled - Notepad")Send("BOOOO I'm a ghost{ENTER}Hahaha{ENTER}")Sleep(500)Send("+{UP 2}")Sleep(500)Send("!f")Send("x")WinWaitActive("Notepad")Send("y")Send("heeeeeeee.txt")WinWaitClose("Untitled - Notepad")
TehWhale Posted November 5, 2008 Posted November 5, 2008 (edited) Why not write the text to the file without opening it with notepad? FileWrite("test.txt", "BOOO I'm a GHOST"&@CRLF&"hahahaha"&@CRLF) Edited November 5, 2008 by TehWhale
Malkey Posted November 5, 2008 Posted November 5, 2008 (edited) Hunter said: I'm trying to make it Open Note Pad Type text and then Save. I'm stuck at the Save part. It goes in and types the text that I want it to save as. But it won't "click" the save button. I need the code for it. Heres the script.When the save file dialog window appears, the save button is ready to receive "Enter". $answer = MsgBox(4, "Pwnage Notepad", "This script will run Notepad type in some text and then quit. Run?") If $answer = 7 Then MsgBox(0, "AutoIt", "OK. Bye!") Exit EndIf Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("BOOOO I'm a ghost{ENTER}Hahaha{ENTER}") Sleep(500) Send("+{UP 2}") Sleep(500) Send("!f") Send("x") WinWaitActive("Notepad") Send("y") Send("heeeeeeee.txt") Send("{ENTER}") WinWaitClose("Untitled - Notepad") You were really close. One more command and you had it. Edited November 5, 2008 by Malkey
Hunter Posted November 5, 2008 Author Posted November 5, 2008 Malkey said: When the save file dialog window appears, the save button is ready to receive "Enter". $answer = MsgBox(4, "Pwnage Notepad", "This script will run Notepad type in some text and then quit. Run?") If $answer = 7 Then MsgBox(0, "AutoIt", "OK. Bye!") Exit EndIf Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("BOOOO I'm a ghost{ENTER}Hahaha{ENTER}") Sleep(500) Send("+{UP 2}") Sleep(500) Send("!f") Send("x") WinWaitActive("Notepad") Send("y") Send("heeeeeeee.txt") Send("{ENTER}") WinWaitClose("Untitled - Notepad") You were really close. One more command and you had it.Ah, thank you.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now