InDesign CS3 Text FLow Automation...ish help?

Greetings gurus and everyone better than I,

I am very new to Applescript and after trying to wrap my head around some of the more basic concepts feel it would be better in the long run to ask for much needed assistance from those who know rather than feel my brain ooze from my ear. I did a search through the site to see if perhaps there was anything close to what I am looking for, however it is somewhat specialized, so I didn’t find anything to match.

What I am looking for is a script that will do several things:

A) count the number of text lines/rows in layout “A” text box
B) take into account “higher” objects with run-arounds on them
C) in text file “B” read formatted text and identify paragraph breaks (classified listings)
D) copy groups of paragraphs (classified listings) from text file “B” back into layout “A” text box to fit in the open spaces, between the “higher” objects with run-arounds on them.
E) repeat process for the entire layout “A” document, using all the listings in text file “B”

I hope that was clear, but I’ll try to explain further here. I work for my local newspaper and we go through the process of copying and pasting classifieds into columns in the paper layout. Our boss is very particular in how the classifieds are entered, in that the must be complete listings between the regular display ads - he doesn’t want any listings to be split apart, as in half at the bottom of the page and the remaining half at the top in the next column over. We have tried to find a program/plugin out there to handle this but so far have come up empty. Since Applescript is pretty much built into every program (if I understand that correctly) then it should be doable for this purpose.

We are looking to have the script be able to identify how many rows of text can fit in the “visible” parts of the columns in the text box on the layout page, then toggle over to our formatted text file and copy paragraphs (out classifieds are separated by hard returns) to fill the open spaces without splitting them around placed objects to the front of the layout page text box or from the bottom of the text box to the top of the next column over. And then when that visible section in the column is filled, move on to the next section and continue the process.

Those are the basics of the script I would like to have help with. There are more advanced features I would love to get put in, but would be happy to start with a working script to accomplish the above. If there is anyone who can help me with this I would greatly appreciate it.

I thank you in advance for any help that can be offered.

Sincerely,
-Velkyn

My first suggestion would be to find out if your boss is willing to pay for a consultant to work with your newspaper on this. You have a problem that could mostly, if not completely, solved with AppleScript. Ethically, since you and your boss don’t know how to go about doing this, and there is not an off the shelf solution you should pay someone for their efforts in helping you.

There are a lot of variables to deal with, from paragraph formating to the line composer, InDesign’s text engine, the word processor’s text engine and the differences in how it handles text from InDesigns, run-a-rounds, etc. This is probably not a simple script to build, and even if you get something that works in most situations you would probably still need a visual QA on the results. I would suggest getting a consultant involved that has experience with scripting InDesign. If you need help justifying the expense count the time you do this manually, multiply that by the number of editions a year for a base figure. From experience on doing similar tasks you could easily save 50-75% of that time with a well thought out scripting solution.