Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingtosh/9823a0fb9024c2263ea41047e106d276 to your computer and use it in GitHub Desktop.
Save kingtosh/9823a0fb9024c2263ea41047e106d276 to your computer and use it in GitHub Desktop.
Illustratorの選択テキストを本当の標準字形に戻すスクリプト
//Illustratorの選択テキストを本当の標準字形に戻す
var selObj = activeDocument.selection;
if (selObj.length > 0) {
//オブジェクト選択
for (var i = 0; i < selObj.length; i++) {
if (selObj[i] != undefined){
if (selObj[i].typename== "TextFrame") {
var myText = selObj[i].textRange;
setDefaultForm(myText);
}
}
}
//カーソルで選択
if (selObj.typename == "TextRange") {
var myText = selObj;
setDefaultForm(myText);
}
app.redraw();
}
function setDefaultForm(myText){
for (var i = 0; i < myText.length; i++) {
myText.characters[i].characterAttributes.alternateGlyphs = AlternateGlyphsForm.DEFAULTFORM;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment