Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted (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 by MiserableLife
Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...