Jump to content

Closing the script not working(im new here)


Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
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

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

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