是否可以编写一个 Abobe Photoshop (cs6) 脚本来操作包含图像的窗口? 例如,我想将缩放级别设置为特定值,或更改滚动条上的值。我尝试了很多东西,包括脚本监听器,但它没有记录我正在谈论的事件。
有人知道这是否可行吗?
最佳答案
对于缩放,您可以执行以下操作。基于线程here
setZoom (25);
function setZoom( zoom ) {
cTID = function(s) { return app.charIDToTypeID(s); };
var docRes = activeDocument.resolution;
activeDocument.resizeImage( undefined, undefined, 72/(zoom/100), ResampleMethod.NONE );
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( cTID( "Mn " ), cTID( "MnIt" ), cTID( 'PrnS' ) );
desc.putReference( cTID( "null" ), ref );
executeAction( cTID( "slct" ), desc, DialogModes.NO );
activeDocument.resizeImage( undefined, undefined, docRes, ResampleMethod.NONE );
}
关于javascript - 操纵窗口的 Photoshop 脚本(缩放、滚动等),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20637779/