🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1967

Re: [CS3 JS] Add formatted text

#1967
From: Dirk.Becker
Date: Thu, 22 Jan 2009 10:42
12 lines
1011 bytes
You can set the properties of your insertion point before inserting the text.

var ip = app.activeDocument.textFrames.item(0).insertionPoints.item(200);
ip.appliedCharacterStyle = "BigRed";
ip.contents = "Hello, world!";

You could even do it in one step:

app.activeDocument.textFrames.item(0).insertionPoints.item(100).properties = { appliedCharacterStyle : "BigRed", contents: "Hello, world!" };

Hth,
Dirk
Technical Details
Message-ID: <59b78f09.4@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
References: <59b78f09.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,206da833d0337304
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Dirk.Becker <indesign-lists@jdbecker.de>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: [CS3 JS] Add formatted text
Message-ID: <59b78f09.4@webcrossing.la2eafNXanI>
Date: Thu, 22 Jan 2009 02:42:32 -0800
References: <59b78f09.-1@webcrossing.la2eafNXanI>
Lines: 15
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit