В Photoshop CC Javascript - у меня есть следующий фрагмент кода, целью которого является удаление 4 различных выделений из моего активного слоя.Выбор правильный, но я не могу удалить или вырезать его из активного слоя.
var doc = app.activeDocument;
var obj = doc.activeLayer;
var top = [[0, 0], [0, small_indent], [doc_w, small_indent], [doc_w, 0]];
var left = [[0, 0], [0, doc_h], [small_indent, doc_h], [small_indent, 0]];
var right = [[doc_w-small_indent, 0], [doc_w-small_indent, doc_h], [doc_w, doc_h], [doc_w, 0]];
var bottom = [[0, doc_h-small_indent], [0, doc_h], [doc_w, doc_h], [doc_w, doc_h-small_indent]];
var selections = [top, left, right, bottom];
for (var i = 0; i < selections.length; i++) {
doc.selection.select(selections[i]);
doc.selection.remove();
}
Но эта строка doc.selection.remove();
приводит к следующей ошибке
Error 24: doc.selection.remove is not a function.
Я также пытался
doc.selection.cut();
obj.selection.remove();
obj.selection.cut();
И они приводят к одной и той же ошибке.