ps 代码编写
- 作者仓库星标 5
- 许可证 MIT
- 作者仓库 00bx-photoshop-mcp
§4 BATCHPLAY REFERENCE
Use this section ONLY when no dedicated tool exists for your operation (Rule R7).
4.1 DESCRIPTOR FORMAT
[
{
_obj: "commandName", // Event string code (required)
_target: [{ _ref: "layer", _id: 5 }], // Target (optional)
paramName: value, // Simple value
enumParam: { _enum: "enumType", _value: "enumValue" }, // Enum
unitParam: { _unit: "pixelsUnit", _value: 10.0 }, // Unit value
},
];
4.2 REFERENCE FORMS
{_ref: "layer", _id: 42} // By ID (best)
{_ref: "layer", _enum: "ordinal", _value: "targetEnum"} // Active layer
{_ref: "document", _enum: "ordinal", _value: "targetEnum"} // Active document
{_ref: "channel", _enum: "channel", _value: "RGB"} // RGB composite
4.3 UNIT TYPES
{_unit: "pixelsUnit", _value: 10} // Pixels
{_unit: "percentUnit", _value: 50} // Percentage
{_unit: "angleUnit", _value: 90} // Degrees
{_unit: "densityUnit", _value: 72} // PPI
4.4 OPERATIONS THAT STILL NEED BATCHPLAY
These operations have NO dedicated tool — use execute_batchplay:
Lighting Effects:
[
{
"_obj": "lightingEffects",
"lightList": [
{
"_obj": "lightSource",
"lightType": { "_enum": "lightType", "_value": "spotLight" },
"intensity": 50,
"focus": 60,
"posX": 500,
"posY": 300
}
]
}
]
VIVID_LIGHT blend mode (not supported by set_layer_properties):
[
{
"_obj": "set",
"_target": [
{ "_ref": "layer", "_enum": "ordinal", "_value": "targetEnum" }
],
"to": {
"_obj": "layer",
"mode": { "_enum": "blendMode", "_value": "vividLight" }
}
}
]
Select layer by ID:
[
{
"_obj": "select",
"_target": [{ "_ref": "layer", "_id": 42 }],
"makeVisible": false
}
]
Invert layer pixels (not selection):
[{ "_obj": "invert" }]
4.5 FILTER SCRIPTABILITY TABLE
| Filter | Headless (no dialog) | Notes |
|---|---|---|
| All standard filters | Yes | gaussianBlur, wave, wind, etc. |
| Blur Gallery | May force dialog | Known Adobe bug |
| Camera Raw Filter | No | Always requires dialog. Use Curves/Levels instead |
| Liquify (full mesh) | No | Only liquify_forward works headless |
| Neural Filters | No | Cloud-based, requires dialog |
4.6 EVENT CODE TABLE
Blur: gaussianBlur, motionBlur, radialBlur, smartBlur, surfaceBlur, lensBlur, blurbTransform Distort: wave, twirl, spherize, polar, ripple, oceanRipple, pinch, shear, zigZag, displace, glass Stylize: wind, emboss, findEdges, diffuse, diffuseGlow, glowingEdges, tiles, extrude, solarize Sketch: chrome, basRelief, chalkCharcoal, charcoal, photocopy, stamp, tornEdges, waterPaper, notePaper, plaster, reticulation, halftonePattern, graphicPen Artistic: plasticWrap, dryBrush, filmGrain, fresco, neonGlow, paletteKnife, paintDaubs, roughPastels, smudgeStick, sponge, underpainting, watercolor, posterEdges, coloredPencil, cutout Noise: addNoise, despeckle, dustAndScratches, median, reduceNoise Sharpen: sharpen, unsharpMask, highPass, smartSharpen Render: clouds, $DrfC (diff clouds), lensFlare, fibers/$Fbrs Texture: craquelure, grain, mosaicPlugin, patchwork, stainedGlass, texturizer Pixelate: colorHalftone, crystallize, facet, fragment, mezzotint, mosaic, pointillize Brush Strokes: accentedEdges, angledStrokes, crosshatch, darkStrokes, inkOutlines, spatter, sprayedStrokes, sumi_e Operations: make, set, get, delete, select, move, duplicate, hide, show, transform, crop, canvasSize, imageSize Adjustments: curves, levels, hueSaturation, colorBalance, brightnessEvent, channelMixer, selectiveColor, posterization, thresholdClassEvent, invert, desaturate, gradientMapEvent
§16 BATCHPLAY PRO TIPS
Record your own descriptors:
- Open Photoshop Actions panel
- Record the effect manually
- Panel flyout → "Copy As JavaScript"
- Gives exact descriptor for
execute_batchplay
Action listener (captures descriptors in real-time):
action.addNotificationListener(["all"], (event, descriptor) => {
console.log(event, descriptor);
});
- 流狐分类
- 文档
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @00bx · MIT
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 4.1 DESCRIPTOR FORMAT
4.2 REFERENCE FORMS
4.3 UNIT TYPES
These operations have NO dedicated tool — use executebatchplay: Lighting Effects: VIVIDLIGHT blend mode (not supported by setlayerproperties):
Filter · Headless (no dialog) · Notes All standard filters · Yes · gaussianBlur, wave, wind, etc. Blur Gallery · May force dialog · Known Adobe bug
Blur: gaussianBlur, motionBlur, radialBlur, smartBlur, surfaceBlur, lensBlur, blurbTransform Distort: wave, twirl, spherize, polar, ripple, oceanRipple, pinch, shear, zigZag, displace, glass Stylize: wind, emboss, findEdges, diffuse, diffuseGlow, glowingEdges,…
# §4 BATCHPLAY REFERENCE
Use this section ONLY when no dedicated tool exists for your operation (Rule R7).
## 4.1 DESCRIPTOR FORMAT
```javascript
[
{
_obj: "commandName", // Event string code (required)
_target: [{ _ref: "layer", _id: 5 }], // Target (optional)
paramName: value, // Simple value
enumParam: { _enum: "enumType", _value: "enumValue" }, // Enum
unitParam: { _unit: "pixelsUnit", _value: 10.0 }, // Unit value
},
];
```
## 4.2 REFERENCE FORMS
```javascript
{_ref: "layer", _id: 42} // By ID (best)
{_ref: "layer", _enum: "ordinal", _value: "targetEnum"} // Active layer
{_ref: "document", _enum: "ordinal", _value: "targetEnum"} // Active document
{_ref: "channel", _enum: "channel", _value: "RGB"} // RGB composite
```
## 4.3 UNIT TYPES
```javascript
{_unit: "pixelsUnit", _value: 10} // Pixels
{_unit: "percentUnit", _value: 50} // Percentage
{_unit: "angleUnit", _value: 90} // Degrees
{_unit: "densityUnit", _value: 72} // PPI
```
## 4.4 OPERATIONS THAT STILL NEED BATCHPLAY
These operations have NO dedicated tool — use execute_batchplay:
**Lighting Effects:**
```json
[
{
"_obj": "lightingEffects",
"lightList": [
{
"_obj": "lightSource",
"lightType": { "_enum": "lightType", "_value": "spotLight" },
"intensity": 50,
"focus": 60,
"posX": 500,
"posY": 300
}
]
}
]
```
**VIVID_LIGHT blend mode** (not supported by set_layer_properties):
```json
[
{
"_obj": "set",
"_target": [
{ "_ref": "layer", "_enum": "ordinal", "_value": "targetEnum" }
],
"to": {
"_obj": "layer",
"mode": { "_enum": "blendMode", "_value": "vividLight" }
}
}
]
```
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> 4.1 DESCRIPTOR FORMAT → 4.2 REFERENCE FORMS → 4.3 UNIT TYPES → 4.4 OPERATIONS THAT STILL NEED BATCHPLAY → 4.5 FILTER SCRIPTABILITY TABLE → 4.6 EVENT CODE TABLE
要点 -> Lighting Effects · VIVIDLIGHT blend mode · Select layer by ID · Invert layer pixels (not selection) · Blur · Distort · Stylize · Sketch
文件/命令 -> liquifyforward · executebatchplay · Curves/Levels
内容 SHA-256 -> 6733e7386c49
原文结构
适用与边界
原文中的明确线索
liquifyforward、executebatchplay、Curves/Levels