/*-------------------------------------
Select Parents N Children

Version History
1.0.1 [Current version]  -  Aug 16, 2021
    Change file name.

1.0.0  -  Aug 13, 2021
    Initial release
-------------------------------------*/

//______Files Path______
var thisFile = new File(this);
var thisFolderPath = thisFile.path;
//______Build Main Panel______
function buildUI(thisObj){
    if(thisObj instanceof Panel){
        var win = thisObj;
    }else{
        var win = new Window("palette", "Remove Expressions", [0, 0, 116, 236], {resizeable:true})
        win.center();
        win.show();
        tlnf();
    }       
    return win;
}

var win = buildUI(this);
var buttonRect = [0, 0, 100, 30];
var panelButtonSpace = [5, 5, 5, 5];
var buttonSpace = [55, 0, 55, 0];
var buttonA = win.add("Button", panelButtonSpace + buttonRect, "Rename");

function tlnf(){
	app.beginUndoGroup("IS");
	var proj = app.project;
	var comp = proj.activeItem;
	if(comp){
	var selectedLayers = comp.selectedLayers;
	if(selectedLayers.length > 0){
		for(var i = 0 ; i < selectedLayers.length ; i++){
			n = selectedLayers[i].property("Source Text");
			if(selectedLayers[i] instanceof TextLayer){
				selectedLayers[i].name = n.value;
			}
		}
	}
	}
	app.endUndoGroup();
}

buttonA.onClick = function(){
	tlnf();
}

 

您的电子邮箱地址不会被公开。 必填项已用*标注

请下载到本地观看!因为pdf是用的阿里云盘预览,可能部分字体加载不了。

请安装油猴脚本,并下载月离的万事屋脚本。详情请查看菜单 导航 - 用户指引

请在右上角三个点 - 下载管理 - 找到刚才的文件,选择允许下载。 或者换个浏览器