Question
Resize Canvas Script
I an using a script to increase the canvas size by 211 pixels on the right
The function is called from a button click.
Button Click
$("#btn_Canvas_Size").click(function () {
csInterface.evalScript('Canvas_Bigger()');
});
Function Called from Button
function Canvas_Bigger() {
var srcDoc = app.activeDocument;
// get original width and height
var w = srcDoc.width.value;
var h = srcDoc.height.value;
// Increase canvas size + 211 pixels to the right
// with the anchor in the top left
srcDoc.resizeCanvas(w +211, h, AnchorPosition.TOPLEFT);
}
Question:
I am trying to figure out how to prevent the function from firing on multiple clicks of the button.
I only want the canvas to be resized the once.
Any suggestions please
Ian
