Jump to content

AutoIt Tutorial with Vista (UAC Disabled)


usasma
 Share

Recommended Posts

Hi all! I'm very new to scripting and am having difficuties with this script from the Tutorial:

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("This is some text.")
WinClose("Untitled - Notepad")
WinWaitActive("Notepad", "Do you want to save")
Send("!n")

The difficulty is that the script won't select the "Don't Save" option in the dialog box - so the script won't terminate.

Then, when I click the "Don't Save" option myself, it leaves an icon for the script in my system tray stating "Script Paused"

As a side note, when I placed ;'s before each line (to describe the line's function) - the _ beneath the letters in the last dialog don't appear.

When I use the exact script above, the _ does appear.

Any assistance would be greatly appreciated!

- John

Link to comment
Share on other sites

Welcome to the forum.

See this thread: http://www.autoitscript.com/forum/index.ph...showtopic=51973

One of the goals of the tutorial is to get the user to use the AutoIt Window Info tool. That tool should show you what info can be "seen" by AutoIt.

This line: WinWaitActive("Notepad", "Do you want to save")

Will stop the script on Vista because AutoIt cannot see the window text

"Do you want to save"

So, the script just sits there waiting for a window to become active that contains a title of "Notepad" and window text of "Do you want to save". The problem is, no such window can be "seen" by AutoIt in Vista.

There are several ways around that problem - they are discussed in that thread mentioned above.

enjoy...

[size="1"][font="Arial"].[u].[/u][/font][/size]

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