Javascript Question [evalScript] (Photoshop Panel)
I am currently delving into CEP and Panel creation. I have a button that runs the function below. The event essentially creates a document and names the document to the name stored in the variable in "docName". The code below works:
var docName = "MyDocument"
exec = 'documents.add(500, 500, 72, "' + docName +'")';
csInterface.evalScript(exec);
}
However, I the code doesn't run when I change this line:
exec = 'documents.add(500, 500, 72, "' + docName +'")';
TO
exec = "documents.add(500, 500, 72, " + docName + ")";
Why I am asking is because I want to use the button name (this.name) which is "500" to change the size of the document essentially ending up with:
