Browse the docs

image

Returns the width or height in pixels of the image the running action is working on.

Keyboard Maestro: IMAGE

Details #

image(dimension) takes exactly one argument and returns a number. dimension is "width" or "height", not case-sensitive; anything other than height gives the width.

It reads the image variable, a record with width, height, dpiX and dpiY that the image steps fill in while they run.

Parameters #

Takes 1 argument. {{ image(text) }}

Examples #

image("width")
→ 1920
Sample variableValue
image{"dpiX": 72, "dpiY": 72, "height": 1080, "width": 1920}
image("height")
→ 1080
Sample variableValue
image{"dpiX": 72, "dpiY": 72, "height": 1080, "width": 1920}

Gotchas #

  • Outside an image step there is no image and it stops: image() needs an image: it reads the image the running action works on.

  • The unit is pixels.