Article View: adobe.scripting.indesign
Article #15426Setting Applied Char Style of Nested Style by name
From: Dave_Saunders
Date: Fri, 28 Nov 2003 16:13
Date: Fri, 28 Nov 2003 16:13
27 lines
1750 bytes
1750 bytes
According to the Scripting Guide and the AppleScript dictionary, I should be able to do this:
tell application "InDesign CS"
tell document 1
set myNstyle to nested style 1 of paragraph style "Body"
set applied character style of myNstyle to "Green"
end tell
end tell
unless I'm misunderstanding the meaning of "Can also accept: string."
But while it doesn't give an error, it also doesn't work.
In JavaScript, where the same possibility is mentioned, the similar construction also fails, but at least it gives an error:
myDoc = app.documents[0];
myPstyles = myDoc.paragraphStyles;
myNstyles = myPstyles.item("Body").nestedStyles;
myNstyle = myNstyles[0];
//myNstyle.appliedCharacterStyle = myDoc.characterStyles.item("Green");
with (myDoc) {
myNstyle.appliedCharacterStyle = "Green";
}
So, am I just being stupid? Or is this not really a possibility? I commented out that line that actually does do the job while I was researching how to use just a string for this parameter.
Dave
Technical Details
Message-ID:
<2ccea3bf.-1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!webxShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,f6998017447264e4,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-11-28 08:37:56 PST From: Dave_Saunders@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Setting Applied Char Style of Nested Style by name Message-ID: <2ccea3bf.-1@webx.la2eafNXanI> Date: Fri, 28 Nov 2003 08:13:14 -0800 Lines: 31 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit