User Tools

Site Tools


function:SCREEN

**This is an old revision of the document!**

The SCREEN function returns the position or size of a screen.

SCREEN( index, coordinate )
SCREEN( index, coordinate, percentage )

The SCREEN index can be 0 for the main screen, and then 1 through n are the screens in orientation order from left to right (and top down for screens at the same position). The index can also be one of:

  • Main - the screen with the primary menu bar (as configured in the Displays preferences).
  • Second - the left most screen that does not have the menu bar.
  • Third - the left most screen that is not the Main or Second screen.
  • Internal - the left most screen that is an internal screen (typically on a laptop).
  • External - the left most screen that is not an internal screen.
  • Mouse - the left most screen containing the mouse.
  • Front - the left most screen containing (the most of) the front window.
  • Back - the left most screen not containing (the most of) the front window.
  • Back2 - the second left most screen not containing (the most of) the front window.

The SCREEN coordinate can be:

  • Left
  • Right
  • Top
  • Bottom
  • Width
  • Height
  • MidX
  • MidY

The optional SCREEN percentage parameter specifies a percentage of the width or height to offset by. Offsets are always to the right and down, but negative offsets are allowed.

For example SCREEN(Internal,Left,10%) would be the coordinate of left edge of the internal screen plus 10% of the width of the internal screen. SCREEN(Front,Right,-10%) would be the coordinate of the right edge of the external screen minus 10% of the width of the external screen.

SCREEN sizes and positions are in “points” (so a retina screen will typically have half as many points as pixels).

Coordinates are in absolute coordinates (relative to the top left corner of the main screen).

function/SCREEN.1429683524.txt.gz · Last modified: 2015/04/22 02:18 by peternlewis