Jump to content

Tutorial - Simple Notepad Automation Hangs


Recommended Posts

The script below from the tutorial hangs on the line: WinWaitActive("Notepad", "Do you want to save"). I've tried typing the entire line of text that appears in the box as the second parameter with the same result. If I comment the line out the script runs as expected. If I remove the comma and eliminate the second parameter entirely the script runs as expected. What am I missing, please?

I'm running Vista SP1 on a Compaq C571NR (dual processor) laptop with an account with Admin privileges.

#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.12.0

Author: myName

Script Function:

Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

Run("notepad.exe")

WinWaitActive("Untitled - Notepad")

Send("This is some text.")

WinClose("Untitled - Notepad")

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

Send("!n")

Link to comment
Share on other sites

Does that line actually appear in the save dialog on Vista? (I don't have vista, so I can't check).

With the AutoIT Window Info Tool, if you inspect the save dialog on vista with it, do you see that text listed in the Visible Text section?

Personally, I never use that parameter anyways.

Link to comment
Share on other sites

Does that line actually appear in the save dialog on Vista? (I don't have vista, so I can't check).

With the AutoIT Window Info Tool, if you inspect the save dialog on vista with it, do you see that text listed in the Visible Text section?

Personally, I never use that parameter anyways.

Thanks for your reply. Nope, the text does not appear as visible or invisible text in the Window Info Tool, which leads me to believe that what we are looking at in that box is an image rather than text.

I am curious as to whether the Tutorial script works in XP or other iterations of Windows prior to Vista, but that's just curiosity, I have a practical answer: it doesn't work in Vista. I gather that anomalies such as this are to be expected given that the act of scripting Windows depends on Windows presentations which Microsoft is free to change without consulting us as to how many scripts a change will break. :-)

Thanks again.

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...