You might want to try this:
const batchPlay = require("photoshop").action.batchPlay;
const result = await batchPlay(
[{
"_obj": "make",
"_target": [{
"_ref": "textLayer"
}],
"using": {
"_obj": "textLayer",
"textKey": "MyTextLayer",
"bounds": {
"_obj": "bounds",
"left": {
"_unit": "pixelsUnit",
"_value": 0
},
"top": {
"_unit": "pixelsUnit",
"_value": 0
},
"right": {
"_unit": "pixelsUnit",
"_value": 0
},
"bottom": {
"_unit": "pixelsUnit",
"_value": 0
}
},
"boundingBox": {
"_obj": "boundingBox",
"left": {
"_unit": "pixelsUnit",
"_value": 0
},
"top": {
"_unit": "pixelsUnit",
"_value": 0
},
"right": {
"_unit": "pixelsUnit",
"_value": 0
},
"bottom": {
"_unit": "pixelsUnit",
"_value": 0
}
},
"textShape": [{
"_obj": "textShape",
"char": {
"_enum": "char",
"_value": "paint"
},
"orientation": {
"_enum": "orientation",
"_value": "horizontal"
},
"transform": {
"_obj": "transform",
"xx": 1,
"xy": 0,
"yx": 0,
"yy": 1,
"tx": 0,
"ty": 0
},
"rowCount": 1,
"columnCount": 1,
"rowMajorOrder": true,
"rowGutter": {
"_unit": "pixelsUnit",
"_value": 0
},
"columnGutter": {
"_unit": "pixelsUnit",
"_value": 0
},
"spacing": {
"_unit": "pixelsUnit",
"_value": 0
},
"frameBaselineAlignment": {
"_enum": "frameBaselineAlignment",
"_value": "alignByAscent"
},
"firstBaselineMinimum": {
"_unit": "pixelsUnit",
"_value": 0
},
"base": {
"_obj": "paint",
"horizontal": 0,
"vertical": 0
}
}],
"textStyleRange": [{
"_obj": "textStyleRange",
"from": 0,
"to": 12,
"textStyle": {
"_obj": "textStyle",
"styleSheetHasParent": true,
"fontPostScriptName": "MyriadPro-Regular",
"fontName": "Myriad Pro",
"fontStyleName": "Regular",
"fontScript": 0,
"fontTechnology": 0,
"fontAvailable": true,
"size": {
"_unit": "pixelsUnit",
"_value": 249
},
"impliedFontSize": {
"_unit": "pixelsUnit",
"_value": 249
},
"horizontalScale": 100,
"verticalScale": 100,
"syntheticBold": false,
"syntheticItalic": false,
"autoLeading": true,
"tracking": 0,
"baselineShift": {
"_unit": "pixelsUnit",
"_value": 0
},
"impliedBaselineShift": {
"_unit": "pixelsUnit",
"_value": 0
},
"fontCaps": {
"_enum": "fontCaps",
"_value": "normal"
},
"digitSet": {
"_enum": "digitSet",
"_value": "arabicDigits"
},
"kashidas": {
"_enum": "kashidas",
"_value": "kashidaDefault"
},
"diacXOffset": {
"_unit": "pixelsUnit",
"_value": 0
},
"diacYOffset": {
"_unit": "pixelsUnit",
"_value": 0
},
"markYDistFromBaseline": {
"_unit": "pixelsUnit",
"_value": 0
},
"baseline": {
"_enum": "baseline",
"_value": "normal"
},
"otbaseline": {
"_enum": "otbaseline",
"_value": "normal"
},
"strikethrough": {
"_enum": "strikethrough",
"_value": "strikethroughOff"
},
"underline": {
"_enum": "underline",
"_value": "underlineOff"
},
"ligature": false,
"altligature": false,
"contextualLigatures": true,
"fractions": false,
"ordinals": false,
"swash": false,
"titling": false,
"connectionForms": true,
"stylisticAlternates": false,
"stylisticSets": 0,
"ornaments": false,
"justificationAlternates": false,
"figureStyle": {
"_enum": "figureStyle",
"_value": "normal"
},
"proportionalMetrics": false,
"kana": false,
"italics": false,
"baselineDirection": {
"_enum": "baselineDirection",
"_value": "withStream"
},
"textLanguage": {
"_enum": "textLanguage",
"_value": "englishLanguage"
},
"japaneseAlternate": {
"_enum": "japaneseAlternate",
"_value": "defaultForm"
},
"mojiZume": 0,
"gridAlignment": {
"_enum": "gridAlignment",
"_value": "roman"
},
"noBreak": false,
"color": {
"_obj": "RGBColor",
"red": 147.00164794921875,
"grain": 157.99758911132812,
"blue": 79.002685546875
},
"strokeColor": {
"_obj": "RGBColor",
"red": 0,
"grain": 0,
"blue": 0
},
"baseParentStyle": {
"_obj": "textStyle",
"fontPostScriptName": "MyriadPro-Regular",
"fontName": "Myriad Pro",
"fontStyleName": "Regular",
"fontScript": 0,
"fontTechnology": 0,
"fontAvailable": true,
"size": {
"_unit": "pixelsUnit",
"_value": 12
},
"impliedFontSize": {
"_unit": "pixelsUnit",
"_value": 12
},
"horizontalScale": 100,
"verticalScale": 100,
"syntheticBold": false,
"syntheticItalic": false,
"autoLeading": true,
"tracking": 0,
"baselineShift": {
"_unit": "pixelsUnit",
"_value": 0
},
"impliedBaselineShift": {
"_unit": "pixelsUnit",
"_value": 0
},
"characterRotation": 0,
"autoKern": {
"_enum": "autoKern",
"_value": "metricsKern"
},
"fontCaps": {
"_enum": "fontCaps",
"_value": "normal"
},
"digitSet": {
"_enum": "digitSet",
"_value": "defaultDigits"
},
"dirOverride": {
"_enum": "dirOverride",
"_value": "dirOverrideDefault"
},
"kashidas": {
"_enum": "kashidas",
"_value": "kashidaDefault"
},
"diacVPos": {
"_enum": "diacVPos",
"_value": "diacVPosOpenType"
},
"diacXOffset": {
"_unit": "pixelsUnit",
"_value": 0
},
"diacYOffset": {
"_unit": "pixelsUnit",
"_value": 0
},
"markYDistFromBaseline": {
"_unit": "pixelsUnit",
"_value": 100
},
"baseline": {
"_enum": "baseline",
"_value": "normal"
},
"otbaseline": {
"_enum": "otbaseline",
"_value": "normal"
},
"strikethrough": {
"_enum": "strikethrough",
"_value": "strikethroughOff"
},
"underline": {
"_enum": "underline",
"_value": "underlineOff"
},
"underlineOffset": {
"_unit": "pixelsUnit",
"_value": 0
},
"ligature": true,
"altligature": false,
"contextualLigatures": false,
"alternateLigatures": false,
"oldStyle": false,
"fractions": false,
"ordinals": false,
"swash": false,
"titling": false,
"connectionForms": false,
"stylisticAlternates": false,
"stylisticSets": 0,
"ornaments": false,
"justificationAlternates": false,
"figureStyle": {
"_enum": "figureStyle",
"_value": "normal"
},
"proportionalMetrics": false,
"kana": false,
"italics": false,
"ruby": false,
"baselineDirection": {
"_enum": "baselineDirection",
"_value": "rotated"
},
"textLanguage": {
"_enum": "textLanguage",
"_value": "englishLanguage"
},
"japaneseAlternate": {
"_enum": "japaneseAlternate",
"_value": "defaultForm"
},
"mojiZume": 0,
"gridAlignment": {
"_enum": "gridAlignment",
"_value": "roman"
},
"enableWariChu": false,
"wariChuCount": 2,
"wariChuLineGap": 0,
"wariChuScale": 0.5,
"wariChuWidow": 2,
"wariChuOrphan": 2,
"wariChuJustification": {
"_enum": "wariChuJustification",
"_value": "wariChuAutoJustify"
},
"tcyUpDown": 0,
"tcyLeftRight": 0,
"leftAki": -1,
"rightAki": -1,
"jiDori": 0,
"noBreak": false,
"color": {
"_obj": "RGBColor",
"red": 0,
"grain": 0,
"blue": 0
},
"strokeColor": {
"_obj": "RGBColor",
"red": 0,
"grain": 0,
"blue": 0
},
"fill": true,
"stroke": false,
"fillFirst": true,
"fillOverPrint": false,
"strokeOverPrint": false,
"lineCap": {
"_enum": "lineCap",
"_value": "buttCap"
},
"lineJoin": {
"_enum": "lineJoin",
"_value": "miterJoin"
},
"lineWidth": {
"_unit": "pixelsUnit",
"_value": 1
},
"miterLimit": {
"_unit": "pixelsUnit",
"_value": 4
},
"lineDashoffset": 0
}
}
}]
},
"_ref": "document",
"_enum": "ordinal",
"_value": "targetEnum",
"_isCommand": true,
"_options": {
"dialogOptions": "dontDisplay"
}
}], {
"synchronousExecution": false,
"modalBehavior": "fail"
});