Get Screen Resolution

Verb: getScreenResolution

Available from: <Standard>

Gets the width and height values, in pixels, of a monitor connected to the machine running the script using, the desired screen index.


getScreenResolution --screenindex(Numeric) (Numeric)=width (Numeric)=height


Script Designer Required AcceptedTypes Description
--screenindex Screen index Required Number Number indicating which of the screens connected to the machine you want the resolution for.


Script Designer AcceptedTypes Description
width Width Number Width in pixels.
height Height Number Height in pixels.


Gets the resolution of the main screen where the script is running.

defVar --name width --type Numeric
defVar --name height --type Numeric
getScreenResolution --screenindex 1 width=width height=height
// Displays the screen resolution in the console.
logMessage --message "${width}\r\n${height}" --type "Info"


In Screen index, the count starts from number 1.

See Also

  • Check If Virtual Machine
  • Count Monitors
  • Get Display Devices
  • Get System Folder Path
  • Lock the Machine
  • Logoff
  • Run
  • Set Screen Resolution
  • Shutdown