Hi, try this one – I've kept the xOff (and yOff, which I assume you'll be using as well) as a separate var, which the onClick handler increases/decreases. function c2t(c) { return app.charIDToTypeID(c); }; function s2t(s) { return app.stringIDToTypeID(s); }; var pngB1 ="/* YOUR LONG PNG STRING */"; var pngB2 ="/* YOUR LONG PNG STRING */"; var xOff = 0; var yOff = 0; win = new Window("dialog", "OffSet Image", [0, 0, 290, 115], { resizeable: true,}); Pnl_logo = win.add("panel", [9, 9, 282, 105]); // Offset + X text_x=Pnl_logo.add("edittext",[76,12,0,0] , " " + xOff + " cm"); text_x.size = [50, 20]; var Offset_x_cima = Pnl_logo.add("image", [0, 0, 0, 0], pngB1); Offset_x_cima.helpTip = "Delocar para a direita!"; Offset_x_cima.size = [20, 10]; Offset_x_cima.location = [59, 12] var Offset_x_bx = Pnl_logo.add("image", [0, 0, 0, 0], pngB2); Offset_x_bx.helpTip = "Deslocar para a esquerda!"; Offset_x_bx.size = [20, 20]; Offset_x_bx.location = [59, 17] statictext_x=Pnl_logo.add("statictext",[10,15,70,29] ,"OffSet X: ",{multiline:true}); //Event Offset + X Offset_x_cima.onClick = function() { var descriptor = new ActionDescriptor(); var descriptor2 = new ActionDescriptor(); var reference = new ActionReference(); reference.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum")); descriptor.putReference(c2t("null"), reference); descriptor.putEnumerated(s2t("freeTransformCenterState"), s2t("quadCenterState"), s2t("QCSAverage")); descriptor2.putUnitDouble(s2t("horizontal"), s2t("distanceUnit"), 15.200000); descriptor2.putUnitDouble(s2t("vertical"), s2t("distanceUnit"), 0.000000); descriptor.putObject(s2t("offset"), s2t("offset"), descriptor2); descriptor.putEnumerated(c2t("Intr"), s2t("interpolationType"), s2t("bicubic")); executeAction(s2t("transform"), descriptor, DialogModes.NO); xOff += 0.5; text_x.text = " " + xOff + " cm"; app.refresh(); } //Event Offset -X Offset_x_bx.onClick = function() { var descriptor = new ActionDescriptor(); var descriptor2 = new ActionDescriptor(); var reference = new ActionReference(); reference.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum")); descriptor.putReference(c2t("null"), reference); descriptor.putEnumerated(s2t("freeTransformCenterState"), s2t("quadCenterState"), s2t("QCSAverage")); descriptor2.putUnitDouble(s2t("horizontal"), s2t("distanceUnit"), -15.200000); descriptor2.putUnitDouble(s2t("vertical"), s2t("distanceUnit"), 0.000000); descriptor.putObject(s2t("offset"), s2t("offset"), descriptor2); descriptor.putEnumerated(c2t("Intr"), s2t("interpolationType"), s2t("bicubic")); executeAction(s2t("transform"), descriptor, DialogModes.NO); xOff -= 0.5; text_x.text = " " + xOff + " cm"; app.refresh(); } win.center(); win.show(); Also, I've cleaned the two Offset_x functions, which appeared to be a mistakenly renamed c2t function, and moved both s2t and c2t functions at the beginning. This doesn't take into account the user entering values himself manually (there's no error checking nor parsing), but if you just need to display the values in .5 steps that should work. In case you need this on Mac as well, be aware that the statictext requires a bit more space and the arrows aren't aligned: the joy of multiplatform development 🙂 Davide
... View more