HudsonKane Posted February 24, 2017 Posted February 24, 2017 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
Developers Jos Posted February 24, 2017 Developers Posted February 24, 2017 Just add an adlib function which checks for the window and act on it when it appears. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
HudsonKane Posted February 24, 2017 Author Posted February 24, 2017 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
Developers Jos Posted February 24, 2017 Developers Posted February 24, 2017 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 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
HudsonKane Posted February 27, 2017 Author Posted February 27, 2017 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
HudsonKane Posted February 27, 2017 Author Posted February 27, 2017 WinGetTitle("[active]") shows the active window title as the main window, not the print dialog, will keep looking
HudsonKane Posted February 27, 2017 Author Posted February 27, 2017 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?
Developers Jos Posted February 27, 2017 Developers Posted February 27, 2017 Is the print dialog running with Admin mode and have your tried running the script as Adminitrator? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
HudsonKane Posted February 27, 2017 Author Posted February 27, 2017 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
jdelaney Posted February 28, 2017 Posted February 28, 2017 (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 February 28, 2017 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.
HudsonKane Posted February 28, 2017 Author Posted February 28, 2017 (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 February 28, 2017 by HudsonKane
HudsonKane Posted March 13, 2017 Author Posted March 13, 2017 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
HudsonKane Posted March 13, 2017 Author Posted March 13, 2017 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now