How to draw a path?

Hi there,

I am using PS 22.3, and do not see how we can create a path (brush, pencil, path) using batchPlay method. I see there are some models coming from the PS, but there are no information about coordinates, so I cannot just send command and create a path, I cannot find any example of how to do it.

I found near topic and the repo: photoshop-types/Path.d.ts at main · simonhenke/photoshop-types · GitHub

But it does not work either, I created model by these typings, and PS returns the error like “You should specify “descriptor” field” (I’ll update this topic later with exact text).

How to send a command to create path using brush/pencil/path tool?
Can somebody show real example of the command, please?

What I am receiving:

Event toolModalStateChanged {
“level”: 1,
“state”: {
“_enum”: “state”,
“_value”: “enter”
},
“tool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“selectedTool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“kind”: {
“_enum”: “kind”,
“_value”: “mouse”
},
“kcanDispatchWhileModal”: true,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event toolModalStateChanged {
“level”: 0,
“state”: {
“_enum”: “state”,
“_value”: “exit”
},
“tool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“selectedTool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“kind”: {
“_enum”: “kind”,
“_value”: “mouse”
},
“kcanDispatchWhileModal”: true,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event historyStateChanged {
“documentID”: 219,
“ID”: 231,
“name”: “New Work Path”,
“hasEnglish”: true,
“itemIndex”: 3,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event toolModalStateChanged {
“level”: 1,
“state”: {
“_enum”: “state”,
“_value”: “enter”
},
“tool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“selectedTool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“kind”: {
“_enum”: “kind”,
“_value”: “mouse”
},
“kcanDispatchWhileModal”: true,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event toolModalStateChanged {
“level”: 0,
“state”: {
“_enum”: “state”,
“_value”: “exit”
},
“tool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“selectedTool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“kind”: {
“_enum”: “kind”,
“_value”: “mouse”
},
“kcanDispatchWhileModal”: true,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event historyStateChanged {
“documentID”: 219,
“ID”: 232,
“name”: “New Anchor Point”,
“hasEnglish”: true,
“itemIndex”: 4,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event toolModalStateChanged {
“level”: 1,
“state”: {
“_enum”: “state”,
“_value”: “enter”
},
“tool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“selectedTool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“kind”: {
“_enum”: “kind”,
“_value”: “mouse”
},
“kcanDispatchWhileModal”: true,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event toolModalStateChanged {
“level”: 0,
“state”: {
“_enum”: “state”,
“_value”: “exit”
},
“tool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“selectedTool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“kind”: {
“_enum”: “kind”,
“_value”: “mouse”
},
“kcanDispatchWhileModal”: true,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event historyStateChanged {
“documentID”: 219,
“ID”: 233,
“name”: “New Anchor Point”,
“hasEnglish”: true,
“itemIndex”: 5,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event toolModalStateChanged {
“level”: 1,
“state”: {
“_enum”: “state”,
“_value”: “enter”
},
“tool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“selectedTool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“kind”: {
“_enum”: “kind”,
“_value”: “mouse”
},
“kcanDispatchWhileModal”: true,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event toolModalStateChanged {
“level”: 0,
“state”: {
“_enum”: “state”,
“_value”: “exit”
},
“tool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“selectedTool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“kind”: {
“_enum”: “kind”,
“_value”: “mouse”
},
“kcanDispatchWhileModal”: true,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event historyStateChanged {
“documentID”: 219,
“ID”: 235,
“name”: “New Anchor Point”,
“hasEnglish”: true,
“itemIndex”: 6,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event toolModalStateChanged {
“level”: 1,
“state”: {
“_enum”: “state”,
“_value”: “enter”
},
“tool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“selectedTool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“kind”: {
“_enum”: “kind”,
“_value”: “mouse”
},
“kcanDispatchWhileModal”: true,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event toolModalStateChanged {
“level”: 0,
“state”: {
“_enum”: “state”,
“_value”: “exit”
},
“tool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“selectedTool”: {
“_obj”: “tool”,
“ID”: “penT”,
“title”: “Инструмент “Перо””
},
“kind”: {
“_enum”: “kind”,
“_value”: “mouse”
},
“kcanDispatchWhileModal”: true,
“_isCommand”: false
}
/ge.adobe.ps.assets.…0421f804445456.js:2 Event historyStateChanged {
“documentID”: 219,
“ID”: 236,
“name”: “Close Path”,
“hasEnglish”: true,
“itemIndex”: 7,
“_isCommand”: false
}

Then I tried command:
{
ID: 10,
count: 20,
itemIndex: 30,
kind: {
_enum: ‘pathKind’,
_value: ‘normalPath’
},
pathContents: {
_obj: ‘pathClass’,
pathComponents: [
{
_obj: ‘pathComponent’,
shapeOperation: {
_enum: ‘shapeOperation’,
_value: ‘add’
},
subpathListKey: [
{
_obj: ‘subpathsList’,
closedSubpath: false,
points: [
{
_obj: ‘pathPoint’,
anchor: {
_obj: ‘point’,
horizontal: 10,
vertical: 10
},
backward: {
_obj: ‘point’,
horizontal: 100,
vertical: 100
},
forward: {
_obj: ‘point’,
horizontal: 200,
vertical: 300
},
smooth: false
}
]
}
],
windingFill: false
}
]
},
pathName: ‘Test’,
targetPath: false
}

And response is:
“error Error: Invalid command Property ‘descriptor’ is missing”

Maybe options are wrong, because I have no idea what should be in some properties using only TS interface, so can somebody send an example of the command how to draw path (brush/pencil/path)?

@simonhenke