Jump to content

Recommended Posts

Posted

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

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

Posted (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 by TehWhale
Posted (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 by Malkey
Posted

  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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...