budinsky Posted May 13, 2010 Share Posted May 13, 2010 I have an annoying popup whenever I print something at work and if I don't press Print on the popup it doesn't print my files.This script solves that problem:----START$var = 1While $var = 1Sleep(2000)WinWaitActive("Print job billing")Send("!p")Wend; Finished!----ENDProblem is I sometimes get this error 'Error connecting to . The RPC server is too busy to complete this operation. [1723]'Why does this happen and what can I do to fix it? Link to comment Share on other sites More sharing options...
budinsky Posted May 13, 2010 Author Share Posted May 13, 2010 I tried to make AutoIt wait thinking that would help but it just made it worse. It reproduced the error instantly so I included the code below so that you can see the error and hopefully tell me what I have done wrong. Thanks $var = 1 While $var = 1 Sleep(2000) WinWait("Print job billing") WinActivate("Print job billing") Send("!p") Wend ; Finished! Link to comment Share on other sites More sharing options...
ripdad Posted May 13, 2010 Share Posted May 13, 2010 (edited) Ah .. printer problems .. gotta love 'em.Let me take a wild guess .. HP?50/50 shot - oh well ...Is that an AutoIt error or your printer software giving the error?Try running this with Notepad -- does it give the same error?Run('Notepad.exe') While 1 Sleep(2000) If WinActive('Untitled - Notepad') Then Send("^p") ExitLoop EndIf WEnd ExitEdit - Scratch that. Edited May 13, 2010 by ripdad "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
DW1 Posted May 13, 2010 Share Posted May 13, 2010 One thing I noticed about your script -- it's sending "!p" every 2 seconds.He is using WinWaitActive() so it shouldn't keep pressing !p every 2 seconds unless the window is active. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
ripdad Posted May 13, 2010 Share Posted May 13, 2010 He is using WinWaitActive() so it shouldn't keep pressing !p every 2 seconds unless the window is active.umm .. look at the code again - please "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
DW1 Posted May 13, 2010 Share Posted May 13, 2010 OK, I looked again. Yep, still using WinWaitActive() in the top version, and WinWait() in the second post version.Both WinWaitActive() and WinWait() "Pauses execution of the script" AutoIt3 Online Help Link to comment Share on other sites More sharing options...
ripdad Posted May 13, 2010 Share Posted May 13, 2010 @danwilli oops .. I misread it. Probably because I don't use those functions. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
DW1 Posted May 13, 2010 Share Posted May 13, 2010 @danwillioops .. I misread it.Probably because I don't use those functions.No worries AutoIt3 Online Help 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