Maximize window and then resize it to its original size

Hi everyone.
I searched extensively on the forum but did not find an answer to my question.

I need to know the size of a foreground window and save this information in a variable to retrieve later.

Basically my macro opens a browser window, maximizes it, performs a series of actions. In the end I would like it to go back to the initial size it was opened with.

Imagine that the 1 second pause in the image, is the action.
Thank you!

Your Variable FrameDimension is storing four values separated by commas - for the left, top, width and height of the window. For example: 155,38,835,887

To use those four values you can either use:

FrameDimension.left
FrameDimension.top
FrameDimension.width
FrameDimension.height

or

FrameDimension[1]
FrameDimension[2]
FrameDimension[3]
FrameDimension[4]

Either will work.

EXAMPLE Maximize then Restore.kmmacros (4.2 KB)

Click to Show Image of Macro

1 Like

Thank you! I tried every possible combination. Now it's very clear.
I understood the general explanation on the wiki, but I didn't know how to write it correctly.

Thanks! :blush: