Hi everyone, Im trying to automate my slice exporting process and I almost got my plugin working, but Its just that one thing in my way. When you open Save for Web(legacy) and you hit “save” there is this second window that appears (called “Save optimized as”) and there is the “Slice:” dropdown where you have - “All slices”, “All user Slices” and the one that im after “Selected Slices”.
It seems that this options depends on the last export, and no matter what I do, if the last export was say with “All slices” selected, photoshop disregards my code (which says “Selected slices”) and falls back to “All slices”. Now the cavemen workaround would be to export once manually(with the desired option) and then never touch this option ever again but thats kind of dumb and very user unfriendly.
It also seems that Photoshop sometimes “forgets” this setting and fall back to default.
The logic behind my script is to export slices one by one and im using this the following batch action.
It works fine till the moment someone change the options in “Save optimized as”.
The descriptor for my option has to be this thing - $SWsl: { _enum: “$STsl”,_value: “$SLSs”},
where $SLSs is “Selected slices” and the “All slices” has to be $SLAL.
Any help would be greatly appreciated as my workflow heavily relies on slices and there is no way around it.
const result = await batchPlay(
\[
{
\_obj: "export",
using: {
\_obj: "SaveForWeb",
$Op: {
\_enum: "$SWOp",
\_value: "$OpSa"
},
$DIDr: true,
in: {
\_path: await tokenifyTEST(exportPath),
// \_path: await tokenify(exportPath),
\_kind: "local"
},
pathName: uxpPath,
format: {
\_enum: "$IRFm",
\_value: "$PN24"
},
interfaceIconFrameDimmed: false,
transparency: true,
$Mtt: true,
$EICC: false,
$MttR: 255,
$MttG: 255,
$MttB: 255,
$HScl: {
\_unit: "percentUnit",
\_value: 100
},
$VScl: {
\_unit: "percentUnit",
\_value: 100
},
$SHTM: false,
$SImg: true,
$SWsl: {
\_enum: "$STsl",
\_value: "$SLSs"
},
$SWch: {
\_enum: "$STch",
\_value: "$CHsR"
},
$SWmd: {
\_enum: "$STmd",
\_value: "$MDCC"
},
$ohXH: false,
$ohIC: true,
$ohAA: true,
$ohQA: true,
$ohCA: false,
$ohIZ: true,
$ohTC: {
\_enum: "$SToc",
\_value: "$OC03"
},
$ohAC: {
\_enum: "$SToc",
\_value: "$OC03"
},
$ohIn: -1,
$ohLE: {
\_enum: "$STle",
\_value: "$LE03"
},
$ohEn: {
\_enum: "$STen",
\_value: "$EN00"
},
$olCS: false,
$olEC: {
\_enum: "$STst",
\_value: "$ST00"
},
$olWH: {
\_enum: "$STwh",
\_value: "$WH01"
},
$olSV: {
\_enum: "$STsp",
\_value: "$SP04"
},
$olSH: {
\_enum: "$STsp",
\_value: "$SP04"
},
$olNC: \[
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC00"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC19"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC28"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC24"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC24"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC24"
}
}
\],
$obIA: false,
$obIP: "",
$obCS: {
\_enum: "$STcs",
\_value: "$CS01"
},
$ovNC: \[
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC01"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC20"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC02"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC19"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC06"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC24"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC24"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC24"
}
},
{
\_obj: "$SCnc",
$ncTp: {
\_enum: "$STnc",
\_value: "$NC22"
}
}
\],
$ovCM: false,
$ovCW: true,
$ovCU: true,
$ovSF: false,
$ovCB: true
},
\_options: {
dialogOptions: "dontDisplay"
}
}
\],
{}
);

