I have a list of more than 1300 names in an InDesign CS2 document, sectioned off by graduating class year, and I need to have each group sorted alphabetically by last name. The last name is the last word on each line. Even using drag-and-drop text, this would take a long time.
It would be helpfull to have a script that can sort a selection of Pgrphs (in this case, a specific grad year) and have them sorted via the last name(word). How would I do this? I found no fucntion like this in InDesign CS2.
If I understand this you have a story of names and years that people graduated. Each paragraph begins with the date? and then has a list of people who graduated that year seperated by soft returns? If you could clear up this and give any other parameters such as paragraph or character styles that could or should be taken into account.
This shouldnt bee too hard to do depending on what you have to start with. If you could load the text into a list then you could sort that list and then replace the old text with the new, sorted list. Things that would throw a wrench into this would be local text formatting.
Actually, every name is a separate paragraph. My aim would be to select the paragraphs under each year heading and then running a sort. I’m not too keen on the alphabetizing lingo I would need to use, though. I have no formatting applied to any of this at the moment.
Then I would load the contents into a strig and parse the information, sort it, and replace the existing text with the newly sorted text. The easiest way to do this might be to work on a selection rather than sorting the entire story at once becouse this would take less work identifying the portions of the text to sort. You might check out http://share.studio.adobe.com/axAssetDetailSubmit.asp?aID=13283&back=http%3A%2F%2Fshare.studio.adobe.com%2FaxBrowseSubmit.asp%3Ft%3D54 for a java script sort rutine. I havent’ used it but it might help you.