1

我是 Photoshop JSX 脚本的新手。到目前为止,我编写了一个小“hello world”脚本,它保存了第一个历史快照的 jpg 图像。

我想要知道活动图像中存在的历史快照的数量,但我找不到任何好的信息或示例。

4

2 回答 2

1

您需要遍历并测试为每个Document.HistoryStates调用的布尔值-如果状态是快照。snapshottrue

于 2014-10-11T08:39:15.577 回答
1

这是解决方案(感谢 c.pfaffenbichler):

xvar myDoc = app.activeDocument;
var theHist = myDoc.historyStates;
var theSnaps = new Array;
for (var m = 0; m < theHist.length; m++) {
var theState = theHist[m];
if (theState.snapshot == true) {theSnaps.push(theState)}
};
alert (theSnaps.length);

好的。不是吗?

于 2014-10-17T09:09:00.537 回答