I would like to apply a gradientMap on a selected layer in Photoshop 2025.
Is there any way for being able to specifically work with loaded Presets and call them only by name? As shown below, I’m able to select a chosen map, but only if the values for the texture are specified manually. The problem with the below is that this is already a default gradient map for Purple01, so through the UI no such values need to be declared. Can the same be done in any way through action Commands?
async function actionCommands() {
const result = await batchPlay(
[
{
_obj: "set",
_target: [
{
_ref: "adjustmentLayer",
_enum: "ordinal",
_value: "targetEnum"
}
],
to: {
_obj: "gradientMapClass",
gradient: {
_obj: "gradientClassEvent",
name: "Purple_01",
gradientForm: {
_enum: "gradientForm",
_value: "customStops"
},
interfaceIconFrameDimmed: 4096,
colors: [
{
_obj: "colorStop",
color: {
_obj: "RGBColor",
red: 247.00000047683716,
grain: 114.0000008046627,
blue: 209.00000274181366
},
type: {
_enum: "colorStopType",
_value: "userStop"
},
location: 0,
midpoint: 50
},
{
_obj: "colorStop",
color: {
_obj: "RGBColor",
red: 199.99611228704453,
grain: 114.0000008046627,
blue: 241.99610978364944
},
type: {
_enum: "colorStopType",
_value: "userStop"
},
location: 4096,
midpoint: 50
}
],
transparency: [
{
_obj: "transferSpec",
opacity: {
_unit: "percentUnit",
_value: 100
},
location: 0,
midpoint: 50
},
{
_obj: "transferSpec",
opacity: {
_unit: "percentUnit",
_value: 100
},
location: 4096,
midpoint: 50
}
]
}
},
_options: {
dialogOptions: "dontDisplay"
}
}
],
{}
);
}