Article View: adobe.scripting.indesign
Article #1920Re: Font for inserting glyph [JS]
From: Peter Kahrel
Date: Thu, 15 Jan 2009 17:45
Date: Thu, 15 Jan 2009 17:45
10 lines
972 bytes
972 bytes
if (app.selection[0].constructor.name == "InsertionPoint"){
with (app.selection[0].insertionPoints[0]){ // insertion point
appliedFont = 'Arial\tRegular';
contents = String.fromCharCode(0x20A6);
}
}
Font family and style are in one string, separated by a tab (\t). By the way, you can insert a unicode character like this: .contents = '\u20A6' -- saves on typing!
Peter
Technical Details
Message-ID:
<59b78587.1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossingReferences:
<59b78587.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,5f33cd378ee108cf X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Peter Kahrel" <kahrel@kahrel.plus.com> Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: Font for inserting glyph [JS] Message-ID: <59b78587.1@webcrossing.la2eafNXanI> Date: Thu, 15 Jan 2009 09:45:46 -0800 References: <59b78587.-1@webcrossing.la2eafNXanI> Lines: 12 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit