Jump to content
Sign in to follow this  
wysocki

Waiting for popup window to close

Recommended Posts

wysocki

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?

Share this post


Link to post
Share on other sites
exodius

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

Share this post


Link to post
Share on other sites
wysocki

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.

Share this post


Link to post
Share on other sites
Valuater

maybe..

WinWaitActive("","Preparing Document")

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
wysocki

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")

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.