I got the problem when trying to get width and height of active document. And change Unit to Pixel doesn't work I just open 1 png image into photoshop then run the script. Alert width and height and got "NaN px" Here is my simple code: var startRulerUnits = app.preferences.rulerUnits; app....