博客
关于我
【Photoshop JSX脚本】参考线转换为线
阅读量:507 次
发布时间:2019-03-07

本文共 1465 字,大约阅读时间需要 4 分钟。

if(documents.length) app.activeDocument.suspendHistory('描边参考线', 'main()'); function main(){activeDocument.artLayers.add();activeDocument.activeLayer.name="描边参考线";app.showColorPicker();var newColour = app.foregroundColor;var guideSize = Window.prompt("请输入描边大小!","1");var guides = app.activeDocument.guides;var guideArray = []; for( var g = 0; g < guides.length; g++ ){        singleLine(guides[g].direction.toString(), Number(guides[g].coordinate.value).toFixed(0) );    if(Number(guideSize) > 1)   activeDocument.selection.stroke (newColour, Number(guideSize), StrokeLocation.OUTSIDE, ColorBlendMode.NORMAL, 100, false);   activeDocument.selection.stroke (newColour, Number(guideSize), StrokeLocation.INSIDE, ColorBlendMode.NORMAL, 100, false);}activeDocument.selection.deselect();};function singleLine(pos,pixelPos) {var desc5 = new ActionDescriptor();var ref4 = new ActionReference();ref4.putProperty( charIDToTypeID('Chnl'), charIDToTypeID('fsel') );desc5.putReference( charIDToTypeID('null'), ref4 );var desc6 = new ActionDescriptor();if(pos == "Direction.VERTICAL"){desc6.putUnitDouble( charIDToTypeID('Left'), charIDToTypeID('#Pxl'), Number(pixelPos) );desc5.putObject( charIDToTypeID('T   '), charIDToTypeID('Sngc'), desc6 );}else{desc6.putUnitDouble( charIDToTypeID('Top '), charIDToTypeID('#Pxl'), Number(pixelPos) );desc5.putObject( charIDToTypeID('T   '), charIDToTypeID('Sngr'), desc6 );}executeAction( charIDToTypeID('setd'), desc5, DialogModes.NO );};

 

转载地址:http://zkxjz.baihongyu.com/

你可能感兴趣的文章
MyEcplise中SpringBoot怎样定制启动banner?
查看>>
MyPython
查看>>
MTD技术介绍
查看>>
MySQL
查看>>
MySQL
查看>>
mysql
查看>>
MTK Android 如何获取系统权限
查看>>
MySQL - 4种基本索引、聚簇索引和非聚索引、索引失效情况、SQL 优化
查看>>
MySQL - ERROR 1406
查看>>
mysql - 视图
查看>>
MySQL - 解读MySQL事务与锁机制
查看>>
MTTR、MTBF、MTTF的大白话理解
查看>>
mt_rand
查看>>
mysql -存储过程
查看>>
mysql /*! 50100 ... */ 条件编译
查看>>
mudbox卸载/完美解决安装失败/如何彻底卸载清除干净mudbox各种残留注册表和文件的方法...
查看>>
mysql 1264_关于mysql 出现 1264 Out of range value for column 错误的解决办法
查看>>
mysql 1593_Linux高可用(HA)之MySQL主从复制中出现1593错误码的低级错误
查看>>
mysql 5.6 修改端口_mysql5.6.24怎么修改端口号
查看>>
MySQL 8.0 恢复孤立文件每表ibd文件
查看>>