编程语言/photoshop:修订间差异
来自康健生活
< 编程语言
| 第111行: | 第111行: | ||
==== 图层组(LayerSets) ==== | ==== 图层组(LayerSets) ==== | ||
图层组的合集 | 图层组的合集 | ||
==== | ==== 图层和图层组(layers) ==== | ||
所有图层和图层组的集合 | 所有图层和图层组的集合 | ||
2021年5月26日 (三) 12:00的版本
引言

(来源摘自互联网示例,作者 Adobe-CEP / CEP-Resources)
开发流程
开发模式判断
开发模式: development 生产环境: production 测试环境: beta
日志
CEF日志
windows:
C:\Users\365\AppData\Local\Temp\CEP7-PHXS.log
CEPHtmlEngine日志
windows:
C:\Users\365\AppData\Local\Temp\CEPHtmlEngine7-PHXS-18.1.1-net.qihoo.design.extension.log C:\Users\365\AppData\Local\Temp\CEPHtmlEngine7-PHXS-18.1.1-net.qihoo.design.extension-renderer.log
ScriptingListener plug-in
windows:
C:\Users\365\Desktop\ScriptingListenerJS.log
CEP JavaScript库
API 更改向后兼容。
- CSInterface.js
- IMSInterface.js
- Vulcan.js
ExtendScript
日志
使用 $.writeln() 与 $.write()。
ExtensionManifest
非常重要
全局参数
app
CSInterface
cs.evalScript
app.documents[]
backgroundLayer: undefined
bitsPerChannel: {}
colorProfileType: {}
colorProfileName: "sRGB IEC61966-2.1"
mode: {}
componentChannels: undefined
activeHistoryState: undefined
activeHistoryBrushSource: undefined
activeLayer: undefined
activeChannels: undefined
info: undefined
printSettings: undefined
fullName: {}
height: {}
managed: undefined
saved: false
name: "奇舞团1024.psd"
path: {}
quickMaskMode: false
resolution: 72
selection: undefined
width: {}
histogram: [71535,7293,5468,3646,6469,5214,12183,11680,5003,12525,5398,6748,5388,14143,8384,11624,24381,3429,3230,3114,5720,3640,1221,1629,22467,1158,1153,3571,1436,1623,2773,2077,3484,4585,5683,3904,4154,8292,8442,5839,9008,8966,8784,7912,4083,6197,9375,5235,3243,3502,6795,2597,2191,2476,7599,2162,1984,10587,1354,1593,2474,2097,3794,3398,3559,5777,8850,10196,11919,4187,4749,4922,3912,8149,13649,11313,12215,2526,5300,3627,4856,5406,21288,7746,16727,8153,7885,5069,4892,3826,6051,5245,6941,3454,4765,3015,3973,2262,2001,1680,1866,2102,4390,5216,9510,7924,19941,6510,13280,7135,6444,7524,12219,1076,1169,1106,1181,1184,1172,1738,1086,811,1025,951,637,674,1109,1526,899,944,810,361,1083,1045,949,1384,1146,1112,1687,1045,2216,475,1930,2515,2234,1618,1340,1292,1648,1405,694,2292,1924,702,770,1019,541,1158,601,1447,882,672,717,936,1039,817,702,334,465,533,605,1288,879,1028,1608,435,468,254,9763,384,461,720,302,441,427,486,363,917,606,593,537,926,878,1105,1114,1120,5314,1139,502,1556,1908,634,1297,1358,1917,1766,3203,646,6812,1964,1012,2690,2112,2413,6310,430,2030,3254,1939,2577,1321,2484,2624,1399,1630,5981,6205,633,612,271,416,380,272,413,1976,561,1084,218,583,467,296,292,180,358,210,6174,300,407,307,196,318,142,690,1344,492,31687]
pixelAspectRatio: 1
xmpMetadata: undefined
measurementScale: undefined
id: 255
layers: undefined
layerSets: undefined
artLayers: undefined
channels: undefined
guides: undefined
historyStates: undefined
layerComps: undefined
pathItems: undefined
countItems: undefined
colorSamplers: undefined
cloudDocument: false
cloudWorkAreaDirectory: undefined
typename: "Document"
parent: undefined
parseAppDocument: [{}]
参考:
photoshop dom
图层集合
图层(ArtLayers)
文档根目录的图层的集合。
for (var i =0; i< app.activeDocument.artLayers.length; i += 1) {
$.writeln("图层: " + app.activeDocument.artLayers[i].name);
}
图层组(LayerSets)
图层组的合集
图层和图层组(layers)
所有图层和图层组的集合
遍历图层
function getLayers(layers, count) {
var out = '';
for (var i =0; i<layers.length; i++) {
if(layers[i].typename == 'LayerSet') {
out += '\n ' + new Array(count + 1).join(' ') + '[' + layers[i].name + ']';
out += getLayers(layers[i].layers, count + 1);
} else {
out += '\n ' + new Array(count + 1).join(' ') + layers[i].name;
}
}
return out;
}
$.writeln(getLayers(app.activeDocument.layers, 0));
事件
Photoshop Events (CC2015 ver.16)
ID
* charIDToTypeID: 从四个字符的代码转换为运行时ID Converts from a four character code to a runtime ID * typeIDToCharID: * typeIDToStringID: * stringIDToTypeID:
| charIDToTypeID | 示例 | 示例 |
eventID
debug
错误捕获
Jsxbin
由 ExtendScript Toolkit(ESTK)创建的二进制脚本,该工具用于向 Adobe Creative Suite(CS)应用程序添加扩展。
反编译 Jsxbin 文件
manifest.xml
开发记录
提速
var r = new ActionReference();
var d = new ActionDescriptor();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("layerID"));
r.putEnumerated(stringIDToTypeID("layer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
d.putReference(charIDToTypeID('null'), r);
// 限制getd获取的范围提升代码响应速度,使用 r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("layerID"));
var options = executeAction(charIDToTypeID( "getd" ), d, DialogModes.NO);
var layerID= options.getInteger(stringIDToTypeID("layerID"));
$.writeln (layerID)
开题
参考
- https://console.adobe.io/servicesandapis
- https://github.com/AdobeDocs
- https://github.com/Adobe-CEP
- https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_8.x/Documentation/CEP 8.0 HTML Extension Cookbook.md#debugging-unsigned-extensions
- https://helpx.adobe.com/photoshop/kb/downloadable-plugins-and-content.html
- https://www.adobe.com/devnet/photoshop/scripting.html
- https://github.com/yearbook/extendscript-api-documentation
- https://www.indesignjs.de/extendscriptAPI/indesign-latest/#about.html
- https://github.com/ExtendScript/wiki/wiki
- InDesign JavaScript参考指南
- https://theiviaxx.github.io/photoshop-docs/
- https://www.ps-scripts.com/
- https://www.kirupa.com/motiongraphics/ps_scripting.htm
adobe 参考规范文件
- 文件:Photoshop cc 2014 applescript ref.pdf
- 文件:Photoshop cc 2014 applescript ref 2.pdf
- 文件:Photoshop cc 2014 scripting-guide.pdf
- 文件:Photoshop cc 2014 scripting-guide 2.pdf
- 文件:Photoshop cc 2014 scriptref js.pdf
- 文件:Photoshop cc 2014 scriptref js 2.pdf
- 文件:Photoshop cc 2014 scriptref vbs.pdf
- 文件:Photoshop cc 2014 scriptref vbs 2.pdf
- 文件:Photoshop CS2 AppleScriptReferenceGuide.pdf
- 文件:Photoshop CS2 JavaScriptReferenceGuide.pdf
- 文件:Photoshop CS2 ScriptingGuide.pdf
- 文件:Photoshop CS2 VisualBasicReferenceGuide.pdf
- 文件:Photoshop cs3 applescript ref.pdf
- 文件:Photoshop cs3 javascript ref.pdf
- 文件:Photoshop cs3 scripting guide.pdf
- 文件:Photoshop cs3 vbscript ref.pdf
- 文件:Photoshop cs4 applescript ref.pdf
- 文件:Photoshop cs4 javascript ref.pdf
- 文件:Photoshop cs4 scripting guide.pdf
- 文件:Photoshop cs4 vbscript ref.pdf
- 文件:Photoshop cs5 applescript ref.pdf
- 文件:Photoshop cs5 javascript ref.pdf
- 文件:Photoshop cs5 scripting guide.pdf
- 文件:Photoshop cs5 vbscript ref.pdf
- 文件:Photoshop-2020-applescript-ref.pdf
- 文件:Photoshop-2020-javascript-ref.pdf
- 文件:Photoshop-2020-scripting-guide.pdf
- 文件:Photoshop-2020-vbs-ref.pdf
- 文件:Photoshop-cc-2015-applescript-ref.pdf
- 文件:Photoshop-cc-2015-javascript-ref.pdf
- 文件:Photoshop-cc-2015-scripting-guide.pdf
- 文件:Photoshop-cc-2015-vbs-ref.pdf
- 文件:Photoshop-cc-2019-applescript-ref.pdf
- 文件:Photoshop-cc-2019-javascript-ref.pdf
- 文件:Photoshop-cc-2019-scripting-guide.pdf
- 文件:Photoshop-cc-2019-vbs-ref.pdf
- 文件:Photoshop-CS6-AppleScript-Ref.pdf
- 文件:Photoshop-CS6-JavaScript-Ref.pdf
- 文件:Photoshop-CS6-Scripting-Guide.pdf
- 文件:Photoshop-CS6-VBScript-Ref.pdf
No categories