Hunter Posted November 5, 2008 Share 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.$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") Link to comment Share on other sites More sharing options...
TehWhale Posted November 5, 2008 Share 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 Link to comment Share on other sites More sharing options...
Malkey Posted November 5, 2008 Share Posted November 5, 2008 (edited) 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 Link to comment Share on other sites More sharing options...
Hunter Posted November 5, 2008 Author Share Posted November 5, 2008 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. Link to comment Share on other sites More sharing options...
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