Jump to content

Waiting for popup window to close


Recommended Posts

I'm trying to write a routine that will open a document in WordPerfect and then print it. Following that, I'll do other things like close WordPerfect, start an Excel print job, and others. The problem is that When I start the print command in WordPerfect, it composes the output while displaying a popup that says "Preparing Document". When that popup goes away, I can then safely proceed to close the app or start printing from other apps. How can I tell when this happens?

Link to comment
Share on other sites

Get the Title of that window using the AutoIt Window Info tool, then look in the helpfile under WinWaitClose...

Hmmm, it'll be tricky catching it when it pops up, its title bar is greyed so hovering my mouse above it doesn't show anything in the tool. But I'll also have to wait for it to come up in the first place. Here's what I have but it never gets further than the first SplashTextOn message:

Run("C:\Program Files\WordPerfect Office 12\Programs\wpwin12.exe c:\apps\sue\document.wpd")
WinWaitActive("WordPerfect");main app is loaded
Send("^p!g{tab}1-999{enter}");start printing
SplashTextOn("WP", "Started")
WinWaitActive("WordPerfect 12","Preparing Document")
SplashTextOn("WP", "Waiting")
WinWaitActive("WordPerfect","Preparing Document")
SplashTextOn("WP", "Preparing Document")
WinWaitClose("WordPerfect","Preparing Document")
SplashOff()
Send("!fx")

Guess I'd need someone with WordPerfect to try this.

Link to comment
Share on other sites

Nope! This is what I tried, but no luck (all I see is the first splash):

Run("C:\Program Files\WordPerfect Office 12\Programs\wpwin12.exe c:\apps\sue\document.wpd")
WinWaitActive("WordPerfect");main app is loaded
Send("^p!g{tab}1-999{enter}");start printing
SplashTextOn("WP", "Started")
WinWaitActive("","Preparing Document")
SplashTextOn("WP", "Preparing Document")
WinWaitClose("","Preparing Document")
SplashOff()
Send("!fx")
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...