Sign in to follow this  
Followers 0
forger

vista - simple notepad automation not working

7 posts in this topic

Hello, I think I found a bug related to windows vista and a tutorial in autoit help file

I opened autoit help file > AutoIt v3 > Tutorials > simple notepad automation and pasted the full script at the end of the tutorial in an autoit script file:

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

The problem is that it doesn't work with "Do you want to save" text string. It works in Windows XP though!

Share this post


Link to post
Share on other sites



I've tested this and confirmed it.

This is because WinWaitActive("Notepad", "Do you want to save") doesn't work.

AutoIt just can't find this window and keeps waiting for it.

If the following would be omitted it works.

, "Do you want to save"

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Share this post


Link to post
Share on other sites

Hello, I think I found a bug related to windows vista and a tutorial in autoit help file...

Yep - I thought so too when I posted this as a bug. The answer was:

The tutorial teaches folks to use the "AutoIt Window Info" tool. Had they done so, the final script would function on the OS that they are using.


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

Share this post


Link to post
Share on other sites

Please select the option run as administartor by right click on the exe to execute it.

Share this post


Link to post
Share on other sites

Please select the option run as administartor by right click on the exe to execute it.

I do not think that there is an exe involved in that tut. It is being run as an au3 text file. And the problem stems from the fact that the tut was written using info from XP. Then the screenshots and code was updated for Vista. An attempt was made to find code that would work for both XP and Vista - but it did not workout that way.

Look at the screenshot where "Do you want to save" is circled in red. That text does not even show up as visible text in the window info tool shown in the same screenshot. AutoIt cannot see the text "Do you want to save" and yet it is in the code just below that screenshot:

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

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Sorry for replying so late

As herewasplato says, shouldn't the text from message boxes be recognized in vista? :P

Or it should be at least mentioned for which operating systems they work or not, especially for useful commands such as WinWaitActive

Edited by forger

Share this post


Link to post
Share on other sites

... shouldn't the text from message boxes be recognized in vista? :P ...

It is Vista that changed the way that the info within that message box is presented. Vista made it like a browser window and the text inside cannot be seen... or so I'm told - I've stayed away from Vista as best I can.

... Or it should be at least mentioned for which operating systems they work or not, especially for useful commands such as WinWaitActive ...

You can try your hand at a bug report.

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

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