Jump to content
Sign in to follow this  
Hunter

Open Note Pad Type Text then Save

Recommended Posts

Hunter

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!")

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")

WinWaitClose("Untitled - Notepad")

Share this post


Link to post
Share on other sites
TehWhale

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 by TehWhale

Share this post


Link to post
Share on other sites
Malkey

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 by Malkey

Share this post


Link to post
Share on other sites
Hunter

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.

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  

×