[AE脚本]查找菜单 ID

[AE脚本]查找菜单 ID

源码

/*-------------------------------------
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{
        findID();
    }       
    return win;
}

try{
    var win = buildUI(this);
    var buttonRect = [0, 0, 130, 30];
    var panelButtonSpace = [5, 5, 5, 5];
    var buttonSpace = [55, 0, 55, 0];
    var buttonA = win.add("Button", panelButtonSpace + buttonRect, "Find Menu ID");
    buttonA.onClick = function(){
        findID();
    }
}catch (e){
}
//try catch <-- To make it work even if you don't have it in ScriptUI Panels. もっと他にきれいな方法ある気がするけど今はいいや...

function findID(){
    menu = prompt("Type in the exact menu command you want to know the ID of.","");
    id = app.findMenuCommandId(menu);
    if(menu != ""){
        checkResult();
    }else{
        alert("Type in the exact menu command you want to know the ID of.");
    }
}

function checkResult(){
    var aboutWin = new Window("dialog", "Find Menu Command ID", [0, 0, 350, 150]);
    var headText = aboutWin.add("staticText", [30, 15, 320, 55], "The ID for "" + menu + "" is:nn", {multiline:true});
    var aboutText = aboutWin.add("editText", [30, 40, 320, 112], id, {multiline:true});
    var closeButton = aboutWin.add("Button", [250, 320, 320, 140], "CLOSE");

    closeButton.onClick = function closePanel(){
        aboutWin.close();
    }

    aboutWin.center();
    aboutWin.show();
}

 

给TA充电
共{{data.count}}人
人已充电
AE开发脚本开发

[AE脚本]选择相同源 图层

2021-9-10 9:10:43

AE开发脚本开发

[AE脚本]基于文字内容 重命名图层

2021-9-10 13:52:02

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
今日签到
搜索