Skip to content

Instantly share code, notes, and snippets.

@UskeS
Created April 26, 2019 10:02
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 UskeS/bab9d290cd74bb9863affb4f2478100d to your computer and use it in GitHub Desktop.
Save UskeS/bab9d290cd74bb9863affb4f2478100d to your computer and use it in GitHub Desktop.
選択した場所に指定した範囲のコードポイントの文字を連続して挿入する
var doc = app.activeDocument;
var sel = doc.selection[0];
var startChar = parseInt("21", 16); //入力する文字の最初のコードポイント
var endChar = parseInt("24ff", 16); //入力する文字の最後のコードポイント
app.doScript(function(){
while(startChar < endChar) {
sel.contents += String.fromCharCode(startChar);
startChar++;
}
}, ScriptLanguage.JAVASCRIPT, null, UndoModes.ENTIRE_SCRIPT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment