I’m new at UXP, but well versed in HTML, CSS and Javascript. I set up a plugin using the quick-layers-starter template and it runs fine. I need to create a new blank document so I simply commented out several lines, added the line from the Photoshop API Reference, plus the async keyword to the function. When I reload it and run it nothing happens. No new document, no exceptions in the debugger, nothing. What am I doing wrong? Here’s the index.js code:
async function showLayerNames() {
const app = require(“photoshop”).app;
// const allLayers = app.activeDocument.layers;
// const allLayerNames = allLayers.map(layer => layer.name);
// const sortedNames = allLayerNames.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
// document.getElementById(“layers”).innerHTML = // <ul>${ // sortedNames.map(name =>
Thanks, that worked nicely. Really appreciate your help.
Does that also apply to guides? I ask because once the document is created, app.activeDocument.guides.add(…) doesn’t work in either modal or async context.