Skip to main content
April 12, 2013
Question

Script to insert a character with a given font

  • April 12, 2013
  • 1 reply
  • 532 views

Hello,

I must be silly but I have searched the web for hours and could not find a solution to my "simple" problem:

I  would like a script to do this:

1. set font (eg MT Extra)

2. insert a character based on unicode (eg F080)

3.revert font to previous font

This vould allow me to insert any character of any font and then continue typing my text with the regular font.

Thank you for our help

This topic has been closed for replies.

1 reply

TᴀW
Legend
April 12, 2013

For something basic like this you should check out the documentation that comes with ESTK, under the Help menu. "Adobe Intro to Scripting" is a good place to start.

Anyway, assuming you've got your text cursor blinking in some text, try this:

myIP = app.selection[0];
myIP.contents = "\uf080";
myIP.appliedFont = "MT Extra";

Ariel

id-extras.com | InDesign tools & scripts for typesetters, form designers, and translators
April 13, 2013

Thank you for your advice.

I started to read the documentation and used a part of your code and I was able to reach my goal. I had never used java script before so it took quite a lot of time but I am happy now.