Question
Photoshop API: How to export a layer group to a new PSD file?
Hello. I have a PSD file consisting of several layer groups. I'm trying to use the Photoshop JavaScript API to extract these layer groups into separate PSD files. This is the relevant section of my code:
const axios = require('axios');
...
let psdData = {
"inputs": [{
"href": presignedUrl,
"storage": "external"
}],
"options": <options>
},
"outputs": [{
"storage": "external",
"type": <PSD type>,
"href": uploadURL
}]
}
let config = {
method: 'post',
maxBodyLength: Infinity,
url: '<PSD service URL>',
headers: {
'Authorization': 'Bearer ' + aioToken,
'x-api-key': aioApiKey,
headers
},
data: JSON.stringify(psdData)
};
let resp = await axios.request(config);
The layer groups have predictable names, that could be hardcoded if needed (although this is not ideal).
What should go into <options>, <PSD type> and <PSD service URL> to achieve the desired result?
