NeedSomeHelp1 Posted June 22, 2010 Posted June 22, 2010 Hi - I'm trying to run a script that opens print preview and then sets the page to landscape by sending Alt+L. The problem that I am having is that it trys to send this command before the page has finished loading and it obviously doesn't work. It will work with a sleep command, but I am trying to avoid using sleep to avoid other issues. Is there some other function besides winwait to wait for the window to fully load? My script looks like this: $oIE.execWB(7,1) WinWait("Print Preview") ;Sleep(1000) ControlSend("Print Preview", "","","{ALT}+{L}") Thanks
somdcomputerguy Posted June 22, 2010 Posted June 22, 2010 Have you already tried using the timeout argument in WinWait? - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
NeedSomeHelp1 Posted June 22, 2010 Author Posted June 22, 2010 Wouldn't that be the same thing as using sleep? I just trying to avoid relying on the computer to work at a certain speed, and would like the scipt to run fast instead of waiting for unecessary time as a precaution to make sure everything is loaded.
MiserableLife Posted June 22, 2010 Posted June 22, 2010 (edited) WinWait() waits for the window to exist, it does not know how to wait for the program to load. try using ControlCommand() with the "IsVisible" command to see if the button you want exist. And next time you post your code with [/autoit], like this: [autoit]Msgbox(0,'','Hi') Edited June 22, 2010 by MiserableLife
NeedSomeHelp1 Posted June 22, 2010 Author Posted June 22, 2010 I tried using ControlCommand but theres a problem. The landscape button isn't able to be specifically seen. I tried using the window info tool/ finder tool on it and there is no different on the landscape button than the rest of the window.
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