PS脚本 隐现图层

论坛 期权论坛 脚本     
匿名技术用户   2020-12-21 20:47   172   0

好久没画画了今天想图两笔,打开PS一个老问题,看参考时不方便。自已来一段吧,放到 AdobePhotoshopCS6(64bit\Presets\Scripts\Hide_Show_LS.jsx ,然后按自已习惯设置个热键。OK 隐藏显示图“LS”,主要是为了方便查看参考。当前图层之下,LS为源图。

//===============================================
//隐藏显示当前图层。
//2013-09-20 by Jerry
//===============================================
// Macintosh Finder or the Windows Explorer
#target photoshop
// Make Photoshop the frontmost application
app.bringToFront();
// call the source document
var srcDoc = app.activeDocument;

changeLayerVisible();
function changeLayerVisible()
{
 try{
  srcDoc.activeLayer.visible = !(srcDoc.activeLayer.visible);
 }catch(ee){
  ;
 }
}
//===============================================
//隐藏显示图层“LS” ,JS大小写敏感哦。
//2013-09-20 by Jerry
//===============================================
// Macintosh Finder or the Windows Explorer
#target photoshop
// Make Photoshop the frontmost application
app.bringToFront();
// call the source document
var srcDoc = app.activeDocument;

changeLayerVisible("LS");

function findThisLayer(aLayerName)
{
    try
    {
        //try to find the layer
        return srcDoc.layers.getByName(aLayerName);
    }
 catch(ee)
 {
  ;//do nothing
 }
}

function changeLayerVisible(aLayerName)
{
 try
    {
  findThisLayer(aLayerName).visible = !(findThisLayer(aLayerName).visible);
 }
 catch(ee)
 {
  alert("Layer :'" + aLayerName + "' Not found!");
 }
}
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP