Skip to content

Instantly share code, notes, and snippets.

@monokano
Last active April 17, 2024 20:44
Show Gist options
  • Save monokano/9f8604349d71b8676d73cc3ae95e91cd to your computer and use it in GitHub Desktop.
Save monokano/9f8604349d71b8676d73cc3ae95e91cd 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