Hi, I’m new to UXP and have been looking for a way to store a layer or a layer’s id with a specific parameter/attribute (related to the actions that need to be executed. For example a ‘resize’ or ‘move’) somewhere that would be persistent and linked to the specific document to use later to execute an action on the layer.
this should work on the same layer in a duplicated document.
Something like assigning a variable to a layer in photoshop’s Data Sets.
My other question: Is there a way to access the variables that we set on layers (image > variables > define…) in photoshop’s datasets?
something like this below
const app = require("photoshop").app;
const appCore = require('photoshop').core
const doc = app.activeDocument
const setVariable = async () => {
if (doc.activeLayers.length >= -1){
doc.activeLayers.forEach(async (layer) => {
window.localStorage.setItem(layer.id)
})
}else{
await appCore.showAlert({ message: 'Please select layers to assign a variable to'})
}
}
However local storage is not linked to a document.
Thanks