From iMacros
Jump to: navigation, search

Resizes the browser window.

Syntax iMacros Browser IE Plug-in Firefox Chrome

SIZE X=n Y=m

The size command is necessary mainly when using DirectScreen commands with fixed coordinates, but it may also be necessary when using Image Validation.


  • X
    Specifies the new width of the browser window in pixel.
  • Y
    Specifies the new height of the browser window in pixel.


  1. The SIZE command ensures that the visible browser page is the specified size. The actual size of the entire browser window will be larger than the specified values when you factor in the size of the sidebar, toolbars, etc.
  2. This command does not work when iMacros is -silent or -tray mode.
  3. Available in iMacros for Firefox v10 and later


When using DS the size of the browser window is essential for the success of the command. If the window is resized between recording and replaying the macro the DS command might fail, because the position of the element which is to be clicked has moved. Therefore, it is advisable (especially when you distribute your macros) to add a SIZE command before all DS commands, so that potential window resizing by the user is undone.

SIZE X=800 Y=600 
DS CMD=CLICK X=234 Y=42 CONTENT=Hello<SP>World!

See Also

DS, IMAGECLICK, What factors can cause a macro that uses DirectScreen or image recognition to fail on different machines?