選択しているテキストレイヤーのフォント名とスタイルを取得します。
#target Photoshop var docRef = app.activeDocument; var activeLayer = docRef.activeLayer; if (activeLayer.kind == "LayerKind.TEXT") { var textLayerFont = activeLayer.textItem.font; alert(app.fonts[textLayerFont].family + "," + app.fonts[textLayerFont].style); } else { alert("テキストレイヤーを選択してください。") }
#target Photoshop var docRef = app.activeDocument; var activeLayer = docRef.activeLayer; if (activeLayer.kind == "LayerKind.TEXT") { var fontPostScriptName = app.fonts.getByName(activeLayer.textItem.font).postScriptName alert(fontPostScriptName); } else { alert("テキストレイヤーを選択して下さい。"); }