Change font size dynamically based on character count
Context: I have very basic experience with JavaScript. I mainly know HTML/CSS well.
Let's say I want to fill 1,000 pages with 1,000 phrases. One phrase per page, and the text has to fill the maximum amount of space in the page.
So I think I would need something like this: If "Hello there" is 60pt to fill the page, but the next page contains "How are you?" dynamically change the font size to fit the page (like 40pt). Am I on the right track or should I do something else?
I understand this may have something to do with strings and character counts. I have found some clues in JavaScript but also need help changing some of the language to work in InDesign.
jquery - Change Font Size dynamically based on Character count - Stack Overflow
jquery - Auto-size dynamic text to fill fixed size container - Stack Overflow
