Skip to main content
Participant
March 28, 2008
Question

Creating a new paragraph style based on text in a document

  • March 28, 2008
  • 4 replies
  • 436 views
I'm working on some scripts for a new ad our company is working on. They are wanting to have the ability to change the font weekly in the ads. However, they want the style sheets to change based on this. What I am having to do is write a script that gets the properties of the different paragraphs in the selected text frame, and make paragraph styles. Is there a way to get the properties of paragraph 1, and use that information to make a new paragraph style? Here is what I have so far;

set charaStyle to get properties of character charaSelect of paragraph paraOne of myBox

set makeStyle to make character style with properties {name:"MF Price" & charaSelect, based on:properties of character charaSelect}

We are using InDesign CS 3. Thank you in advance for the help.
This topic has been closed for replies.

4 replies

Participant
April 2, 2008
Harbs, How would I go about doing that? Thank you for the help.
Harbs.
Legend
April 2, 2008
You can use the "properties" property to read and set multiple
attributes at once.

Harbs
Participant
March 28, 2008
Robert,
Thank you for the help. I was hoping there was a easier way of generating style sheets on the fly. Thank you again.
Known Participant
March 28, 2008
this way - build ParaStyle definition from selected text - works only in UI
in scripting you need to write your own procedure - read all params and set them one-by-one in ParaStyle definition

robin

--
www.adobescripts.com