Wednesday, January 19, 2022

#1 2021-12-03 07:46:46 am

dklucznik
Member
Registered: 2005-07-19
Posts: 89

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.

David

Offline

 

#2 2021-12-03 12:22:04 pm

vaccarolim
Member
Registered: 2007-06-04
Posts: 5

Re: Setting attributes of selected text InDesign

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

Offline

 

#3 2021-12-03 04:08:15 pm

mingione
Member
Registered: 2009-07-07
Posts: 12

Re: Setting attributes of selected text InDesign

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.

Andrew

Offline

 

#4 2021-12-06 10:48:36 am

dklucznik
Member
Registered: 2005-07-19
Posts: 89

Re: Setting attributes of selected text InDesign

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

david

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)