Created
August 17, 2018 13:11
-
-
Save UskeS/feeb24c405f47a2a397b35909d54c6fe to your computer and use it in GitHub Desktop.
[InDesign] 合成フォントの各セットに登録されている文字列を抽出する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function() { | |
var doc = app.activeDocument; | |
var compFont = doc.compositeFonts[1]; //0だと[No composite font]になる | |
var cfEnt = compFont.compositeFontEntries; | |
var result = []; | |
for (var i=1; i<cfEnt.length; i++) { //漢字は取得できないのでi=1から | |
result.push("【" + cfEnt[i].name + "】"); | |
result.push(cfEnt[i].customCharacters); | |
} | |
makeTxtFile(result.join("\n"), "~/desktop/"+compFont.name+".txt"); | |
function makeTxtFile(contents, path) { | |
var F = File(path), res; | |
try { | |
F.open("w"); | |
F.encoding = "UTF-8"; | |
res = F.write(contents); | |
} catch(e) { | |
alert(e); | |
} finally { | |
F.close(); | |
} | |
} | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment