【illustrator】「Illustrator効果」を選択しやすいようにポップアップで表示【ショートカット拡張】


var cats = [
    ["3D"],
    ["SVGフィルター"],
    ["スタイライズ"],
    ["トリムマーク"],
    ["パス"],
    ["パスの変形"],
    ["パスファインダ"],
    ["ラスタライズ"],
    ["ワープ"],
    ["形状に変換"]
];
var commands = [
    [ // 3D
        ["押し出し・ベベル","Live 3DExtrude"],
        ["回転体","Live 3DRevolve"],
        ["回転","Live 3DRotate"]
    ],
    [ // SVGフィルター
        ["SVGフィルター","Live SVG Filters"]
    ],
    [ // スタイライズ
        ["ぼかし","Live Feather"],
        ["ドロップシャドウ","Live Adobe Drop Shadow"],
        ["光彩(内側)","Live Inner Glow"],
        ["光彩(外側)","Live Outer Glow"],
        ["落書き","Live Scribble Fill"],
        ["角を丸くする","Live Adobe Round Corners"]
    ],
    [ // トリムマーク
        ["トリムマーク","Live Trim Marks"]
    ],
    [ // パス
        ["オブジェクトのアウトライン","Live Outline Object"],
        ["パスのアウトライン","Live Outline Stroke"],
        ["パスのオフセット","Live Offset Path"],
    ],
    [ // パスの変形
        ["ジグザグ","Live Zig Zag"],
        ["パスの自由変形","Live Free Distort"],
        ["パンク・膨張","Live Pucker & Bloat"],
        ["ラフ","Live Roughen"],
        ["ランダム・ひねり","Live Scribble and Tweak"],
        ["変形","Live Transform"],
        ["旋回","Live Twist"]
    ],
    [ // パスファインダ
        ["追加","Live Pathfinder Add"],
        ["交差","Live Pathfinder Intersect"],
        ["中マド","Live Pathfinder Exclude"],
        ["前面オブジェクトで型抜き","Live Pathfinder Exclude"],
        ["背面オブジェクトで型抜き","Live Pathfinder Minus Back"],
        ["分割","Live Pathfinder Divide"],
        ["刈り込み","Live Pathfinder Trim"],
        ["合流","Live Pathfinder Merge"],
        ["切り抜き","Live Pathfinder Crop"],
        ["アウトライン","Live Pathfinder Outline"],
        ["濃い混色","Live Pathfinder Hard Mix"],
        ["薄い混色","Live Pathfinder Soft Mix"],
        ["トラップ","Live Pathfinder Trap"]
    ],
    [ // ラスタライズ
        ["ラスタライズ","Live Rasterize"]
    ],
    [ // ワープ
        ["円弧","Live Deform Arc"],
        ["下弧","Live Deform Arc Lower"],
        ["上弧","Live Deform Arc Upper"],
        ["アーチ","Live Deform Arch"],
        ["でこぼこ","Live Deform Bulge"],
        ["貝殻(下向き)","Live Deform Shell Lower"],
        ["貝殻(上向き)","Live Deform Shell Upper"],
        ["旗","Live Deform Flag"],
        ["波形","Live Deform Wave"],
        ["魚形","Live Deform Fish"],
        ["上昇"," Live Deform Rise"],
        ["魚眼レンズ","Live Deform Fisheye"],
        ["膨張","Live Deform Inflate"],
        ["絞り込み","Live Deform Squeeze"],
        ["旋回","Live Deform Twist"]
    ],
    [ // 形状に変換
        ["長方形","Live Rectangle"],
        ["角丸長方形","Live Rounded Rectangle"],
        ["楕円形","Live Ellipse"]
    ],
];

function btnForm(arr,action){
    var win = new Window ("dialog");
    win.alignChildren = "center";
    for (i=0; i<arr.length; i+=1){
        win['btn'+i] = win.add("button", undefined, arr[i][0]);
        win['btn'+i].txt = i;
        win['btn'+i].onClick = function() {win.close();end=this.txt;}
    }
    win.cancelBtn = win.add("button", undefined, "cancel"); 
        win.cancelElement = win.cancelBtn;
        win.cancelBtn.onClick = function() {win.close();end=-1;}
    win.frameLocation = [1250,350];
    win.show();
    if (end > -1){
        if (action === true){
            app.executeMenuCommand(arr[end][1]);
        }
        else{
            if (commands[end].length === 1){
                app.executeMenuCommand(commands[end][0][1]);
            }
            else{
                btnForm(commands[end],true);
            }
        }
    }
    win.close();
}

btnForm(cats,false);