Copy link to clipboard
Copied
Let me begin by saying that I know extremely little about scripts, so if you respond with a highly technical answer, I'll be lost! 🙂
I'm using Adobe InDesign 2024 on a 2020 Macbook Pro (Ventura 13.3.1). I have a Bibliography with many entries and was trying to run the "Sort Paragraphs" javascript (as outlined in this article) to sort all entries alphabetically. It is critical that I'm able to retain formatting. For now, I've pulled the Bibliography out of the source document and dropped it into a new InDesign file (see attached).
Each time I run the script (as shown below), InDesign crashes.
Sometimes I get this warning before it crashes:
Can anyone help???? I really don't want to have to sort these manually!
Thanks in advance! - Kristin
Copy link to clipboard
Copied
Make sure you have no empty paragraphs in what you are trying to sort by runnning a Find Grep for multiple returns.
Copy link to clipboard
Copied
I ran the Find Grep and there was one extra return, which I removed. Still getting the same error.
Copy link to clipboard
Copied
Also, try to split your text in half - maybe there is something "extra" in the text? Just for testing.
Copy link to clipboard
Copied
After removing last empty paragraph - It just crashed for me as well.
Copy link to clipboard
Copied
Good suggestions, but no luck. I split the document in half and ran both halves, still encountering the same issue. I did get a warning message this time which said, "All corrupt hyperlinks in the selected text have been removed." I clicked OK, but got the same error message again.
For what it's worth, I've also quit InDesign and then did a hard restart, deleting all preferences. That didn't work either.
Copy link to clipboard
Copied
As per my other reply - your document has been damaged for some reason.
You can either do IDMLing yourself - just for fun - or download file I've attached.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
@Robert at ID-Tasker - So perhaps if I save as an IDML, open it and save as a new INDD file, it might work?
Copy link to clipboard
Copied
That's what I've done - exported as IDML, opened, run sorting and saved and uploaded here for you.
That's a preview of my tool - on the left is effect of the JS script for comparison.
Unfortunately, it's PC only.
Copy link to clipboard
Copied
@Robert at ID-Tasker - Thank you for your help. I tried the same thing on my end, but to no avail. I appreciate you sending me a properly sorted document. I'm going to try and reintegrate that into my original main document, and hopefully all shall go smoothly from there!
Copy link to clipboard
Copied
I tried the same thing on my end, but to no avail.
Does it happen if you create a new document, with a text frame containing Palceholder text—Type>Fill with placeholder Text?
Copy link to clipboard
Copied
@rob day I tried what you suggested (placeholder text, new doc) and everything worked fine. So obviously something is messed up with my Bibliography doc. But I have no idea how to determine which link(s) are corrupted. I'm about to give up and just alphabetize it manually. It will be a pain, but perhaps less painful than these technical issues!
Copy link to clipboard
Copied
I am able to get the error when I select the slow method, and as @brian_p_dts suggests the error occurs on the last empty line—the authors are not catching the last line error. Before you select all, try deleting the two returns at the end:
Copy link to clipboard
Copied
Copy link to clipboard
Copied
@Robert at ID-Tasker Actually, it looks like there are issues with the file you sent over. It appears to be sorted alphabetically, but as you can see from the screenshot below, all of the hyperlinks are broken and some portions of text appear hyperlinked that shoudn't be (see the portions underlined in red).
Copy link to clipboard
Copied
Unfortunately, it might be the fault of the script from InDesign - it uses Bubble Sort - and moves text around....
So hyperlinks might got "damaged".
I'll try to export your document my way - but you have to give me an hour or so - busy with something else at the moment.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
@Robert at ID-Tasker - I'll take a look at that script you just sent. You don't need to work on this anymore. I did discover that there were numerous places where regular text was inadvertently hyperlinked. I removed all of those and hoped that that would solve the problem, but it didn't. Honestly, at this point, it will prob take me less time to just organize them manually. But I'll check out the script you just sent over first. Again, thanks for your help!
Copy link to clipboard
Copied
Sorry it took me so long.
Loading info about all paragraphs takes about 20 seconds.
Fixing text, Sorting and Exporting into a new Story:
Duplicate() method is EXTREMELY fast...
Attached is your sorted document.
The wrong hyperlinks - they are in your original text - they are even visible on your 1st screenshot:
Copy link to clipboard
Copied
Below is partial report of the hyperlinks in your document:
"Biblio" without ".indd" is unsaved IDML version of the original file.
For some reason - you have errors in your original document - and then different errors after IDMLing and sorting - and some of the hyperlinks disappear after IDMLing?
There are 84 in original document - but only 28 after IDMLing?
Copy link to clipboard
Copied
After more digging...
Sorted by Name:
Each Hyperlink is a triplet - that's a raw data from your documents.
If you check column "INDD Doc" - 6th column - there are a lot of hyperlinks from "biblio.indd" - but they are missing after IDMLing - "biblio".
This might suggest that the original file you've uploaded - or even source document from which you've copied text for uploading - is damaged??
Copy link to clipboard
Copied
You are welcome.
I've done it on ID 2024 / v. 19.0.1 on a PC.
Copy link to clipboard
Copied
Hi @kg01915 , It worked for me in CC2021 (Converted), so yes try a Save As IDML and open the IDML.
Copy link to clipboard
Copied
> I'm using Adobe InDesign 2024 on a 2020 Macbook Pro (Ventura 13.3.1).
While it's probably not related to the script issues you're having, make sure to update to the latest version of Ventura, macOS 13.6.x. InDesign can have serious issues on pre-13.5 systems. (Just don't upgrade to macOS 14 Sonoma as it's not fully compatible with InDesign yet).