The only thing I'm seeing is "factor out" the Take the screenshot step. It's common to both second-level if's.
Code: Select all
If A = Window
{
If B!=Image To File ; this is != or not-equals
{
Several clicks to make B the image to file
Sleep, 100
}
Take the screenshot ; saves you a line here, and an else
}
else
{
Several clicks to make A = Window
If B!=Image To File ; this is != or not-equals
{
Several clicks to make B the image to file
Sleep, 100
}
Take the screenshot ; saves you a line here, and an else
}
But isn't that curious? We have two very similar blocks. All of this is common to each other:
Code: Select all
{
If B!=Image To File ; this is != or not-equals
{
Several clicks to make B the image to file
Sleep, 100
}
Take the screenshot ; saves you a line here, and an else
}
The only difference is making A = Window, so, what if we just do this?
Code: Select all
If A != Window
Several clicks to make A = Window
If B!=Image To File ; this is != or not-equals
{
Several clicks to make B the image to file
Sleep, 100
}
Take the screenshot ; saves you a line here, and an else
If the Window and Image to File are correct, then it'll just take the screenshot. If either or both condition(s) is/are not met, it'll complete actions to meet that/those respective condition.