Setting attributes of selected text InDesign

Happy Holidays everyone!

I wrote a bunch of scripts for InDesign work that I do on a daily basis.
I haven’t touched them in years really and I am rusty at the coding for applescript.
I tried this project before but didn’t have success. But I want to revisit it.

The basics is that I have a 2 page InDesign document.
I will import a block of text into this, on page 2.
I would like to run a script that will:

Center the text
Set all text to Universe Regular Font
Set hyphenation off
Set font size to 7 pts

I haven’t worked with stories or paragraphs before, so I’m not exactly sure how to do this.

Does the text box always have to be selected first, or can I simply say something like:
Select LAST text box (since it would be the last object created on the page)

I just need to pointers in the right direction, I can probably flesh out the rest.


use something like this

tell parent story of text frame 1 of page 1 of active document
set justification to center align
set hyphenation to false
set point size to 7
set applied font to “Univers Regular” --use a TAB between Univers and Regular not a space
end tell

Is this a template? If so, you could apply a paragraph style to the box first, and then the imported text would pick up the formatting.


Vacca… thanks… that’s pretty much exactly what I needed to know.
thanks… for me the font is Univers 55 Roman. (silly naming conventions)