Last active
April 17, 2024 20:44
-
-
Save monokano/9f8604349d71b8676d73cc3ae95e91cd to your computer and use it in GitHub Desktop.
Illustratorの選択テキストを本当の標準字形に戻すスクリプト
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
//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