Last active
January 6, 2019 14:44
-
-
Save UskeS/353b433d969beff3c9343a1e744ed1c2 to your computer and use it in GitHub Desktop.
[InDesign][extendScript] 合成フォントの設定を書き出し
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 compFonts = doc.compositeFonts; | |
var result = []; | |
for (var k=1; k<compFonts.length; k++) { | |
result.push("# " + compFonts[k].name); | |
var cfEnt = compFonts[k].compositeFontEntries; | |
for (var i=0; i<cfEnt.length; i++) { | |
result.push("## " + cfEnt[i].name); | |
result.push("* フォント:"+cfEnt[i].appliedFont+"/"+cfEnt[i].fontStyle); | |
result.push("* サイズ:"+cfEnt[i].relativeSize); | |
result.push("* 水平比率:"+cfEnt[i].horizontalScale); | |
result.push("* 垂直比率:"+cfEnt[i].verticalScale); | |
result.push("* BLシフト:"+cfEnt[i].baselineShift); | |
result.push("* スケールオプション:"+((cfEnt[i].scaleOption)?"オン":"オフ")); | |
} | |
result.push("\r"); | |
} | |
makeTxtFile(result.join("\n"), "~/desktop/"+doc.name.replace(/\.indd$/, ".md")); | |
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