Re: Indesign Paragrpah style remapping
Re: Indesign Paragrpah style remapping
- Subject: Re: Indesign Paragrpah style remapping
- From: Stan Cleveland <email@hidden>
- Date: Thu, 07 Jun 2007 17:35:53 -0700
- Thread-topic: Indesign Paragrpah style remapping
On 6/7/07 5:02 PM, Patrik B. wrote:
> I am trying to reassign different paragraphs styles in 15 different documents.
> Currently I have a list of about 20 paragraph style sheets and 20 character
> style sheets.
>
> My repeat loop works fine however I have a problem with the apply new
> paragraph statement
>
> here is the code that does not work
>
> set mystyles to every applied paragraph style of every text style range of
> every story of document 1 whose name is "Paragraph Style 1" (* everything
> after document 1 does not work - how do I word this part or do I have to
> simply cycle through each style *)
> repeat with i in mystyles
> tell text style range of every story of document 1 with applied paragraph
> style (* this part does not work either - it is very easy to just assign one
> style to all but when I am not sure how to word it in order to just address
> one specific instance of a text style range *)
> apply style using mynewstyle with clearing overrides
> end
> end
>
> Any ideas? Is it my syntax or a limitation of indesign cs2?
Patrik,
Here's some code that should get you headed in the right direction:
tell application "Adobe InDesign CS2"
tell document 1
set textRuns to object reference of text style ranges of every story
whose name of applied paragraph style is "Paragraph Style 1"
apply style textRuns using paragraph style "Paragraph Style 2" with
clearing overrides
end tell
end tell
There should be two long lines between the "tell" and "end tell". Rather
than looping through the list of text ranges, you can change them all at
once, as the code above demonstrates. HTH.
Stan C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden