Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Applescript > Indesign - appl...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 1583 of 1612
Post > Topic >>

Indesign - applying paragraph styles

by copy@[EMAIL PROTECTED] (Andrew D) Mar 14, 2008 at 03:16 PM

It's been a while since I've applescripted and it's showing.

I have a rigidly formatted text document placed into Indesign CS(1) and
need to find specific words and apply different paragraph styles to them.
That's the short story.

Here's an example of the placed text:

*CODE*   ZZ111
*ADDRESS*
*HEADING*  ABSOLUTELY MAGNIFICENT
*BULLET 1*  Some text
*BULLET 2*  Some more text
*BULLET 3*  Even more text


I am using Adobe's sample script "TextCleanup.as" as my starting point. If
you haven't used it, it reads in a delimited set of parameters from a text
file and performs a FIND/CHANGE function using that list. 

I've created a text file that enables the script to remove all the words
between the asterisks by replacing each one with nothing or with a bullet
and tab as required.

What I also need it to do is to apply a paragraph style according to the
word it's replacing. So *ADDRESS* would have AddressStyle applied to that
line (para) before *ADDRESS* is deleted.

The line that does the grunt work in the sample script is:

set myFoundItems to (search for myFindString replacing with myChangeString
without whole word and case sensitive)

This obviously performs the find/change and is within a repeat loop so it
replaces all matches.

What I need to do is to tell it to not only change the text string but the
formatting too. The Indesign Scripting Guide says it can do it but it
gives no hint as to how. 

I've added a parameter to each line in the text file for "myStyle" and
edited the script to read this in too. I just don't know how to apply it
to each Find result.

Examples I've found online tend to reference things in a specific order
(Para1, Para2, ...) and are too restrictive given the varierty of
documents I'm dealing with.

That's the long story. 

Thanks in advance,

-- 
Andy D




 5 Posts in Topic:
Indesign - applying paragraph styles
copy@[EMAIL PROTECTED] (  2008-03-14 15:16:23 
Private Message
   2008-03-14 09:13:03 
Private Message
   2008-03-15 13:18:20 
Private Message
   2008-03-14 23:29:24 
Private Message
   2008-03-15 20:50:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 14:10:54 CDT 2008.