HudsonKane

Process system modal print dialog

13 posts in this topic

We are trying to automate some printing tasks for an application that we do not control.  When the "Save Print Output As" dialog appears, it is system modal.  The user cannot click to the desktop or activate any other windows.  Our script also stops at this point.  Is there anyway to handle this type of dialog?  I am guessing not, but wanted to get confirmation.

Thank you

Share this post


Link to post
Share on other sites



Thank you.  I have set this up, and I can see the function being called by updating the display in a ProgressSet() call however my

if WinExists("Save Print Output As") Then

check never returns true.  I will continue to investigate and post back anything I find

Share this post


Link to post
Share on other sites

Have you checked with au3info what the exact text is for the window or visible text in the window to ensure it is correct?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I can't activate au3info as the dialog is system model.  I will try to enumerate through all windows to see if I am missing something

Thank you

Share this post


Link to post
Share on other sites

WinGetTitle("[active]") shows the active window title as the main window, not the print dialog, will keep looking

Share this post


Link to post
Share on other sites

My progress bar shows my AdlibRegister() function being accessed, and I send keystrokes to the active window, but nothing happens.  I have tried moving the mouse to where the buttons are and sending a mouse click, pressing escape, and sending text, but no automated activity seems to be making it to the print dialog.  This is a .NET application, so that may be part of the issue?

Share this post


Link to post
Share on other sites

neither is run as admin, the process is being run via remote desktop and we currently do not have access to admin rights.  I will try to get this access and try again.

Thank you

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

For modal clicks, I send the controlclick as another process...Like this from the helpfile:

Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(4096, ''Hello World!'', ''Hi!'')"')

Then that new process get's deadlocked while your script proceeds.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Thank you for the suggestion, but running automation through a new process does not work either.  I can see that the script continues through a progress display and logging to a file, but no screen actions or Send() commands appear to work.  If I create a top most dialog it still appears behind the print dialog until I manually close the print dialog.  I am thinking this all may be due to running via remote desktop, but am not sure yet

Edited by HudsonKane

Share this post


Link to post
Share on other sites

#12 ·  Posted

I see the issue now....the print dialog is displaying on the main PC, not the remote desktop pc.  I will have to investigate this further

Share this post


Link to post
Share on other sites

#13 ·  Posted

To finish this thread off...

The remote desktop session was not allowed to use printing resources on that PC (windows 2008 server), it was only allowed to access Local printing resources.

The two pc's do have access to the same mapped network location so..

To overcome this we created 2 scripts.

Process #1
on the main pc we have a listener that waits for the "print save output as" dialog, it then gets the desired file name from a flag file created by process #2
then writes out a "process complete" flag file

Process #2
performs all the processing to get to the item to print, writes our a flag file with the desired file name, and calls up the print dialog
waits until a "process complete" flag file exists, then removes it and carries on

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