Quantcast
Channel: Adobe Community : All Content - InDesign Scripting
Viewing all articles
Browse latest Browse all 8771

[AS CS6] paragraph content replace

$
0
0

Hi,

 

Inspired by an old script found in InDesign magazine for replacing table data, from a document to another and keeping the paragraph styles of the receiving document, I'm now trying to do the same thing but with multiple paragraphs. I know that you can copy and paste without formating from one document to another and this will keep the style. I'm trying to do the same thing but on multiple paragraphs selection that are not the same Paragraph styles. The following script does the samething then copying and pasting without formating on a multiple paragraphs selection.

 

tellapplication "Adobe InDesign CS6"

          ifnot (existsdocument 2) then

  beep

  activate

                    display dialog "This script requires two documents open, with equivalent table areas selected." buttons {"OK"}

                    return

          endif

 

          setParaCount1tocountofparagraphsofselectionofdocument 1

          setParaCount2tocountofparagraphsofselectionofdocument 2

          if (ParaCount1is notequal toParaCount2) then

  beep

  activate

                    display dialog "The number of paragraphs don't match." buttons {"OK"}

                    return

 

          endif

 

          setcontentsofselectionofdocument 2 tocontentsofselectionofdocument 1

 

endtell

 

I've tried a couple of thing with repeating loops but I can't figure out out how to loop in two documents at the same time and having the item from document 1 a replace the coresponding item in document 2.

 

Anybody as done this before? Any pointers?

 

I'd like to have:

 

Contents of paragraph 1 of document 1 to contents of paragraph 1 of document 2

Contents of paragraph 2 of document 1 to contents of paragraph 2 of document 2

Contents of paragraph 3 of document 1 to contents of paragraph 3 of document 2

 

TIA

Jeff

 

 



Viewing all articles
Browse latest Browse all 8771

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>