• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Numbers and Lists and Quark
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: AETE? How can I read these
  • Next by Date: Re: Reality Check (Was... I lost count)
  • Previous by thread: Re: Numbers and Lists and Quark
  • Next by thread: RE: Numbers and Lists and Quark
  • Index(es):
    • Date
    • Thread