Sign in to follow this  
Followers 0
4g3n7oo42o

Closing the script not working(im new here)

8 posts in this topic

Run("notepad.exe")

WinWaitActive("Untitled - Notepad")

Send("This is some text.")

WinClose("Untitled - Notepad")

WinWaitActive("Notepad", "Do you want to save")

Send("!n") <--- this is tha problem i cant get the programe to close

i know its not anything major but i just need help on if there is another way i can get this to close before i move on to the next thing

i would greatly appricate it

Share this post


Link to post
Share on other sites



That does make it close...


"I think, therefore I am"[size="1"]René Descartes[/size]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Run("notepad.exe")

WinWaitActive("Untitled - Notepad")

Send("This is some text.")

WinClose("Untitled - Notepad")

WinWaitActive("Notepad", "Do you want to save")

Send("!n") <--- this is tha problem i cant get the programe to close

i know its not anything major but i just need help on if there is another way i can get this to close before i move on to the next thing

i would greatly appricate it

If you're on Windows Vista this line won't work: "WinWaitActive("Notepad", "Do you want to save")".

For some reason AutoIt can't read vista's message boxes. If you're on XP then I'm clueless ;)

Edited by Szhlopp

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Try this right before the code

AutoItSetOption("SendKeyDelay", 20)

AutoItSetOption("SendKeyDownDelay", 50)

or tell it to hold down alt then press N.

Send("{! down}")

Send("n")

Send("{! up}")

Edited by burners

~~--Feel Free to Steal my Sigs --~~FLAT LOOK____________________________________ROUNDED LOOK

Share this post


Link to post
Share on other sites

dang didnt take vista in consideration. I dual boot XP for autoit programming.


~~--Feel Free to Steal my Sigs --~~FLAT LOOK____________________________________ROUNDED LOOK

Share this post


Link to post
Share on other sites

well burner i thank you for your insite but i still have the same problem. An i do have vista for that matter but everything workd fine just the closeing script. Ive tryed few of ur methods of holding down "!" and sending the n. Im going to look around a lil more to see what i can conjuer up and thx to the other ppl that did there best to help and oh yeah shzlopp so u think it that one line that making it not close cuz it pops up if i wanna save.... hmmmm ill see what i can do thx ppl

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

The problem is in your win wait active.

This works

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("This is some text.")
WinClose("Untitled - Notepad")
WinWaitActive("Notepad")
Send("!n")
Edited by burners

~~--Feel Free to Steal my Sigs --~~FLAT LOOK____________________________________ROUNDED LOOK

Share this post


Link to post
Share on other sites

Burner thank u so much +karmafor ya bro

The problem is in your win wait active.

This works

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("This is some text.")
WinClose("Untitled - Notepad")
WinWaitActive("Notepad")
Send("!n")

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  
Followers 0