Reorder paragraph(s) in story by paragraph style -script?
We have a 3rd party system that imports data into InDesign story boxes to create product catalogs using XML. The process is XML, but the final text in InDesign is just text with paragraph and character styles. There are no XML tags or structure.
I'm coming across an issue where I need to reorder the data, but any changes to the way the 3rd party system imports data requires lots of money for dev work and of course the time to add to a sprint, test, and deploy.
Has anyone come across a similar issue or have any ideas where to look for a solution or start a script? My first thought was to apply the XML tags, export the XML from InDesign and then reimport using an XSLT, but that could be clunky. Ideally I'd like to place the cursor in a story and run a script that looks for the blocks of data by paragraph and reorders it.
Ex data named by paragraph style
Original order:
Name
Item Number
Details
Size
Price
Name Chinese
Details Chinese
Size Chinese
New order
Item Number
Name
Name Chinese
Details
Details Chinese
Size
Size Chinese
Price
