编程语言/photoshop:修订间差异
来自康健生活
| 第159行: | 第159行: | ||
== 开发记录 == | == 开发记录 == | ||
* [[/开发记录|开发记录]] | * [[/开发记录|开发记录]] | ||
== 提速 == | |||
<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> | |||
== 开题 == | == 开题 == | ||
* [[/Photoshop插件开发版本差异|Photoshop插件开发版本差异]] | * [[/Photoshop插件开发版本差异|Photoshop插件开发版本差异]] | ||