查看“︁编程语言/photoshop”︁的源代码
来自康健生活
←
编程语言/photoshop
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 引言 == [[文件:Adobe ps dom comm.jpg|400px|无框|无|Adobe ps dom comm]] {{Unknown|Adobe-CEP / CEP-Resources}} == 开发流程 == 开发模式判断 <pre> 开发模式: development 生产环境: production 测试环境: beta</pre> == 日志 == === CEF日志 === windows: <pre> C:\Users\365\AppData\Local\Temp\CEP7-PHXS.log</pre> ==== CEP缓存清理 ==== === CEPHtmlEngine日志 === windows: <pre> 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</pre> === ScriptingListener plug-in === windows: <pre> C:\Users\365\Desktop\ScriptingListenerJS.log</pre> == CEP JavaScript库 == API 更改向后兼容。 * CSInterface.js * IMSInterface.js * Vulcan.js == ExtendScript == === 日志 === 使用 <code>$.writeln()</code> 与 <code>$.write()</code>。 {{Warning|console 未定义}} == ExtensionManifest == 非常重要 == 全局参数 == === app === [[/打印app参数|打印app参数]] === CSInterface === ==== cs.evalScript ==== ==== app.documents[] ==== <pre> 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: [{}] </pre> 参考: * https://theiviaxx.github.io/photoshop-docs/Photoshop/Document.html == photoshop dom == === 图层集合 === ==== 图层(ArtLayers) ==== 文档根目录的图层的集合。 <syntaxhighlight lang="javascript"> for (var i =0; i< app.activeDocument.artLayers.length; i += 1) { $.writeln("图层: " + app.activeDocument.artLayers[i].name); }</syntaxhighlight> ==== 图层组(LayerSets) ==== 图层组的合集 ==== 图层和图层组(layers) ==== 所有图层和图层组的集合 === 遍历图层 === <syntaxhighlight lang="javascript"> 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));</syntaxhighlight> == 事件 == === 属性 === {| class="wikitable" |- ! 属性 !! 名称 !! 作用 |- | type || 类型 || 识别事件的名称 |- | scope || 作用范围 || "APPLICATION" (当前宿主应用)或者 "GLOBAL" (全局 |- | appId || 应用 ID || 生成事件的宿主应用的识别名称。可选 |- | extensionId || 扩展 ID || 生成事件的扩展的识别名称。可选 |- | data || 数据 || 事件携带的数据 |} ==== 事件类型 ==== * 宿主程序事件(applicationActivate、documentAfterActivate 等)。 * 自定义事件。 ==== 参考 ==== [[/photoshop_Events_CC2015_ver_16|Photoshop Events (CC2015 ver.16)]] === 返回值 === 选中图层事件: <syntaxhighlight lang="javascript"> {"_obj":"select","layerID":[136],"makeVisible":false,"null":{"_name":"多字体和颜色","_ref":"layer"}}</syntaxhighlight> 切换 PSD 文档事件(根据 documentID): <syntaxhighlight lang="javascript"> {"documentID":416,"null":{"_offset":-1,"_ref":"document"}}</syntaxhighlight> == ID == <pre> * charIDToTypeID: 从四个字符的代码转换为运行时ID Converts from a four character code to a runtime ID * typeIDToCharID: * typeIDToStringID: * stringIDToTypeID: </pre> {| class="wikitable" |- | [[/charIDToTypeID|charIDToTypeID]] || 示例 || 示例 |} === eventID === {{Warning|<code>com.adobe.PhotoshopCallback</code>{{Version|photoshop cc 2015}} 被弃用。并启用 <code>com.adobe.PhotoshopJSONCallback</code>,同时必须将ExtensionID作为后缀添加。}} == debug == [[chrome://inspect/#devices|chrome 端口调试]] == 错误捕获 == == Jsxbin == 由 ExtendScript Toolkit(ESTK)创建的二进制脚本,该工具用于向 Adobe Creative Suite(CS)应用程序添加扩展。 === 反编译 Jsxbin 文件 === == manifest.xml == [[/manifest.xml|manifest.xml]] == 开发记录 == * [[/开发记录|开发记录]] == 提速 == <syntaxhighlight lang="javascript"> 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)</syntaxhighlight> == 签名 == === 开发者模式 === 绕过签名。 * windows === 证书 === ==== 自签名证书(self-signed certificates) ==== ==== 商业签名证书(commercial certificates) ==== === ZXPSignCmd === Adobe 官方发布的签名与打包的命令行工具。 * 创建证书 <blockquote><pre> ZXPSignCmd -selfSignedCert <countryCode> <stateOrProvince> <organization> <commonName> <password> <outputPath.p12> ZXPSignCmd -selfSignedCert <国家代码> <地区> <组织名> <证书所有者名称> <证书密码> <证书名.p12> </pre></blockquote> {{Shc_out|<syntaxhighlight lang="shell"> .\ZXPSignCmd.exe -selfSignedCert CN Beijing design.qihoo.net qihoo kangjian design-qihoo.p12</syntaxhighlight>|<syntaxhighlight lang="bash"> Signed successfully </syntaxhighlight>|PS|C:\work\ZXPSignCMD }} * 签名并打包 <blockquote><pre> ZXPSignCmd -sign <inputDirectory> <outputZxp> <p12> <p12Password> -tsa <timestampURL> ZXPSignCmd -sign <要打包的项目目录> <输出文件路径> <证书路径> <证书密码> -tsa <时间戳服务地址> </pre></blockquote> {{Shc_out|<syntaxhighlight lang="shell"> .\ZXPSignCmd.exe -sign ".\zip\net.qihoo.design\" ".\zip\net.qihoo.design.zip" ".\design-qihoo.p12" "kangjian"</syntaxhighlight>|<syntaxhighlight lang="bash"> Signed successfully </syntaxhighlight>|PS|C:\work\ZXPSignCMD }} == 用户数据或者下载内容 == == 二进制 == window.cep.fs? === 文件路径 === Unix 风格的 <code>/</code> 分隔,Windows 风格的 <code>\\</code>。 ==== 跨平台路径处理 ==== 路径标准化 <code>path.normalize()</code> 常用路径 {| class="wikitable" |- | process.execPath || 示例 || 示例 |- | __dirname || 示例 || 示例 |- | __filename || 示例 || 示例 |- | cs.getSystemPath(SystemPath.USER_DATA) || 示例 || 示例 |- | cs.getSystemPath(SystemPath.COMMON_FILES || 示例 || 示例 |- | cs.getSystemPath(SystemPath.MY_DOCUMENTS) || 示例 || 示例 |- | cs.getSystemPath(SystemPath.HOST_APPLICATION) || 示例 || 示例 |} === Base64 === cep.encoding.convertion * .b64_to_ascii(base64str) Base64 字符串 以 ascii 编码转换为字符串 * .b64_to_utf8(base64str) Base64 字符串 以 UTF-8 编码转换为字符串 * .b64_to_binary(base64str) Base64 字符串以二进制编码转换为字符串 * .ascii_to_b64(ascii) * .utf8_to_b64(str) * .binary_to_b64(binary) 文件写入二进制数据,必须得使用 Base64 模式??? window.cep.fs.writeFile ("D:/B.ico", inf.data, "Base64"); == 开题 == * [[/Photoshop插件开发版本差异|Photoshop插件开发版本差异]] == 参考 == * 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%208.0%20HTML%20Extension%20Cookbook.md#debugging-unsigned-extensions 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 * [http://www.jongware.com/idjshelp.html InDesign JavaScript参考指南] * https://theiviaxx.github.io/photoshop-docs/ * https://www.ps-scripts.com/ * https://www.kirupa.com/motiongraphics/ps_scripting.htm * http://objjob.phrogz.net/ * http://jongware.mit.edu/ == adobe 参考规范文件 == * [[File:photoshop_cc_2014_applescript_ref.pdf]] * [[File:photoshop_cc_2014_applescript_ref_2.pdf]] * [[File:photoshop_cc_2014_scripting-guide.pdf]] * [[File:photoshop_cc_2014_scripting-guide_2.pdf]] * [[File:photoshop_cc_2014_scriptref_js.pdf]] * [[File:photoshop_cc_2014_scriptref_js_2.pdf]] * [[File:photoshop_cc_2014_scriptref_vbs.pdf]] * [[File:photoshop_cc_2014_scriptref_vbs_2.pdf]] * [[File:Photoshop_CS2_AppleScriptReferenceGuide.pdf]] * [[File:Photoshop_CS2_JavaScriptReferenceGuide.pdf]] * [[File:Photoshop_CS2_ScriptingGuide.pdf]] * [[File:Photoshop_CS2_VisualBasicReferenceGuide.pdf]] * [[File:photoshop_cs3_applescript_ref.pdf]] * [[File:photoshop_cs3_javascript_ref.pdf]] * [[File:photoshop_cs3_scripting_guide.pdf]] * [[File:photoshop_cs3_vbscript_ref.pdf]] * [[File:photoshop_cs4_applescript_ref.pdf]] * [[File:photoshop_cs4_javascript_ref.pdf]] * [[File:photoshop_cs4_scripting_guide.pdf]] * [[File:photoshop_cs4_vbscript_ref.pdf]] * [[File:photoshop_cs5_applescript_ref.pdf]] * [[File:photoshop_cs5_javascript_ref.pdf]] * [[File:photoshop_cs5_scripting_guide.pdf]] * [[File:photoshop_cs5_vbscript_ref.pdf]] * [[File:photoshop-2020-applescript-ref.pdf]] * [[File:photoshop-2020-javascript-ref.pdf]] * [[File:photoshop-2020-scripting-guide.pdf]] * [[File:photoshop-2020-vbs-ref.pdf]] * [[File:photoshop-cc-2015-applescript-ref.pdf]] * [[File:photoshop-cc-2015-javascript-ref.pdf]] * [[File:photoshop-cc-2015-scripting-guide.pdf]] * [[File:photoshop-cc-2015-vbs-ref.pdf]] * [[File:photoshop-cc-2019-applescript-ref.pdf]] * [[File:photoshop-cc-2019-javascript-ref.pdf]] * [[File:photoshop-cc-2019-scripting-guide.pdf]] * [[File:photoshop-cc-2019-vbs-ref.pdf]] * [[File:Photoshop-CS6-AppleScript-Ref.pdf]] * [[File:Photoshop-CS6-JavaScript-Ref.pdf]] * [[File:Photoshop-CS6-Scripting-Guide.pdf]] * [[File:Photoshop-CS6-VBScript-Ref.pdf]]
此页面嵌入的页面:
模板:Meta box
(
查看源代码
)
模板:Shc out
(
查看源代码
)
模板:Shc out/style.css
(
查看源代码
)
模板:Unknown
(
查看源代码
)
模板:Version
(
查看源代码
)
模板:Version/style.css
(
查看源代码
)
模板:Warning
(
查看源代码
)
模板:Warning/style.css
(
查看源代码
)
返回
编程语言/photoshop
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。