Re: Numbers and Lists and Quark
Re: Numbers and Lists and Quark
- Subject: Re: Numbers and Lists and Quark
- From: email@hidden
- Date: Thu, 6 Sep 2001 14:40:38 -0600
Here's a fun way to solve your every-other paragraph style problem--except
this works for any number of paragraphs (and paragraph styles) that occur
in a consistent pattern:
--place the style names you will be using in a list; names must match
exactly
set styleNames to {"Bold", "Body"}
tell application "QuarkXPress? 4.11"
tell document 1
tell story 1
--get the count of the paragraphs
set theCount to count of paragraphs
--get the count of the styles you will be using
set styleCount to count of styleNames
--now repeat through the paragraphs
repeat with i from 1 to theCount
--here's the formula that does the work
set styleNum to ((i + styleCount - 1) mod styleCount) + 1
set style sheet of paragraph i to item styleNum of styleNames
end repeat
end tell--story
end tell--document
end tell--application
...and you were wondering how you would ever use mod!
Shirley Hopkins
AppleScripting QuarkXPress, AppleScripting InDesign