zergling Posted May 1, 2006 Share Posted May 1, 2006 I'm trying to run a script that opens an application then prints the file using Adobe Distiller. If a file exist then a window will pop-up asking to Overwrite ? Yes No button. What commands would I use to detect and write a If Then statement? Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 1, 2006 Share Posted May 1, 2006 (edited) check out runwait, NVM fileprnts only going to work if you can open it in notepad, but u said u wanted to print it with whatever the heck adobe distiller is, and fileexist and control click Edited May 1, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
Valuater Posted May 1, 2006 Share Posted May 1, 2006 Welcome to thr forums normally you show us some code... then we help you search help for WinExists() Msgbox() 8) Link to comment Share on other sites More sharing options...
zergling Posted May 1, 2006 Author Share Posted May 1, 2006 Sorry for being too general. When the Distiller program prints, if it detects a file with same name, a window will pop-up. Now all I need is a command to detect if that window pops up and Then run a command to click the Yes Button. Here is some simple code: . . . WinWaitActive("Print Setup") Send("!n") Send("a") Send("!z") Send("1") Send("!a") WinWaitActive("Print Setup") ControlCommand("Print Setup", "", "Button7", "Check", "") WinWaitActive("Print") ControlCommand("Print", "", "Button16", "Check", "") WinWaitActive("Print") ControlCommand("Print", "", "Button10", "Check", "") WinWaitActive("Save PDF File As") ControlFocus("Save PDF File As", "", "Edit1") Send("c:\work\fabtest.pdf") ControlCommand("Save PDF File As", "", "Button2", "Check", "") Thanks! Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 2, 2006 Share Posted May 2, 2006 (edited) so did u get it or not?, it looks like u did with the winwaitactive for save pdf file as Edited May 2, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
slightly_abnormal Posted May 2, 2006 Share Posted May 2, 2006 you could probably use.. send("^p") btw anyone know why send("{lctrl}+{p}") doesn't open the print dialog in sciTe? off topic i know.. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 2, 2006 Share Posted May 2, 2006 (edited) o haha nvm doenst work Edited May 2, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
zergling Posted May 2, 2006 Author Share Posted May 2, 2006 I have tried the WinGetText command to get definitive text for the pop-up. It seems the Title of the window is the same as the parent window ("Save FDF File As"). So it seems that any command that I pass to execute a command on the ("Save FDF File As") window get executed on the parent. Have anyone seen this? Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 2, 2006 Share Posted May 2, 2006 (edited) to you give me a shot of both with windows with save PDF file as? you could possibly try $size = WinGetClientSize("Save PDF File As") MsgBox(0, "Active window's client size is (width,height):", $size[0] & " " & $size[1]) get there sizes then just do like an if $size[0] = NUMBER and $size[1] = NUMBER then do something Edited May 2, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
zergling Posted May 2, 2006 Author Share Posted May 2, 2006 (edited) Parent window: Child (Pop-up if file already exist) window: Edited May 2, 2006 by zergling Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 2, 2006 Share Posted May 2, 2006 possibly $times = 0 While 1 $size = WinGetClientSize("Save PDF File As") If $size[0] = 563 and $size[1] = 419 and $times = 0 Then ControlFocus("Save PDF File As", "", "Edit1") Send("c:\work\fabtest.pdf") $times = 1 Elseif $size[0] = 245 and $size[1] = 126 and $times = 1 Then ControlCommand("Save PDF File As", "", "Button2", "Check", "") $times = 2 wend Link to comment Share on other sites More sharing options...
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