Creating a new paragraph style based on text in a document

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 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

Similar Messages

  • Create a new table style based on an existing table in a document

    Hi,
    In a document I'm working on, there is a specific table. It is made in the past by a colleague, and it has a very suitable format.
    Therefore I would like to use the layout of this table on all future tables in my document (or even in others).
    Is there an option to select my table, and create a new table style with it, so that I can use it over and over again? That would be very helpful.
    I'm working in MS Word, MS Office Professional Plus 2010, on a Windows 7 64-bit OS.
    Best regards, Sietske
    Ps.: I know
    a question like this was already asked, but the answer was quite dissatisfying (because it was not answering the question)
    Pps: Note that I'm now creating a new table style from scratch, so an answer to the above question is not that urgent, but it would still be nice to know for future use.

    you can  use format painter
    i hope that you already know about it.
    Nope, not the right answer. With Format Painter, you can copy the format of the table, but you can't create a new Table Style with it. I am looking for a solution as well.

  • How do I create a new paragraph Style in Pages for iPad?

    I opened an RTF document in iOS 6 Pages for iPad. How do I create new paragraph Syles?

    Style is a function of the template applied to the document (and/or the limited number built in to Pages). You can mofify the text or apply one of the built in styles, but I do not beleive within Pages in iOS you can create a new style.
    http://help.apple.com/pages/ipad/1.6.1/

  • Create paragraph style based on selection

    Is there a way to create a paragraph style based on the selection in the same way the "New Paragraph Style" dialog box does without having to go through ALL of the elements of the style individually?
    Thanks

    I was hoping (even expecting) that this would work:
    if (app.documents.length > 0 &&
        app.selection.length === 1 &&
            app.selection[0].hasOwnProperty("baseline")) {
        var myDoc = app.documents[0];   
        var myPstyle = myDoc.paragraphStyles.add({
            properties : app.selection[0].properties,
            name : "myNewStyle"});
    but the result is very disappointing, particularly with respect to the font details. Maybe you just can't use the properties property as part of an add() method call, because this works pretty well:
    if (app.documents.length > 0 &&
        app.selection.length === 1 &&
            app.selection[0].hasOwnProperty("baseline")) {
        var myDoc = app.documents[0];   
        var myPstyle = myDoc.paragraphStyles.add({name : "myNewStyle"});
        myPstyle.properties = app.selection[0].properties;
    Dave

  • RH9: Can't create a new RoboHelp Style for tables

    I'm using TCS3 (FM 10, RH9) in a Windows XP environment.
    I have some tables in FM10 that I want to map to a RH style.  I'm on the Conversion Settings dialog box, and don't have a RH style to map to.  In RH7 I was able to create a new RH style and then map my FM style to it.  I don't see where that is possible in RH9.
    Thanks in advance for your help.

    Peter,
    Yes, the CSS that I am using is the one that I used to create the table. I use Dreamweaver for my CSS.  Here is the HTML that was created in DW when I created the table in RH:
    table.MultiColumn {
            font-family: Tahoma;
            font-size: 11pt;
            border-left-style: Solid;
            border-left-color: #000000;
            border-right-style: Solid;
            border-right-color: #000000;
            border-top-style: Solid;
            border-top-color: #000000;
            border-bottom-style: Solid;
            border-bottom-color: #000000;
            x-border-spacing: 0px;
            border-left-width: 1px;
            border-right-width: 1px;
            border-top-width: 1px;
            border-bottom-width: 1px;
            padding-left: 2px;
            padding-right: 2px;
            padding-top: 2px;
            padding-bottom: 2px;
    table.MultiColumn td {
            padding-left: 2px;
            padding-right: 2px;
            padding-top: 2px;
            padding-bottom: 2px;
    Please note that MultiColumn is one the FM table paragraph tags. When I created the table in RH, I named it MultiColumn and then mapped the FM style to the RH style. Here is the topic HTML:
    <a name="XREF_id09AND0Z0DHS"></a>Deployed Version field descriptions
    Following are field descriptions for the
    Deployed Version page views.
    There is nothing that indicates that there is a table in this topic.  We didn't have this problem in RH7.  All the tables came over beautifully.
    Thanks for your persistent help.

  • Adding new "Paragraph Styles"

    Hi,
    I am trying to modify different text styles in different cells in Numbers 3.5.2 (Yosemite) and I cannot figure out how add a new Paragraph Style to the existing drop-down styles list. Is there a duplicate existing style or add a new style option in this Numbers version? The "+" next to "Paragraph Styles" in the drop-down list does not work in Numbers but works in Pages or Keynote, is this a bug?
    Thanks for the help!

    I found the answer and posting it in case others have the same issue.
    A text inside the cell has to be selected for the "+" sign to be activated, just selecting an empty cell alone does not activate the "+" sign.

  • I just got the new Iphone 5 and when I send a message in a group text it keeps sending it as an email and as my phone number. The people in the group text are complaining that it is creating a new group message everytime I text. How do I fix this?

    I just got the new Iphone 5 and when I send a message in a group text it keeps sending it as an email and as my phone number. The people in the group text are complaining that it is creating a new group message everytime I text. How do I fix this?

    Read http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    If you wish to share an Apple ID with family members then read: http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/

  • Create a new Font style format in pages

    I have looked very hard in pages and I cant seem to find a setting to change the default fonts and settings. I have just created a document with the settings I want and I saved it as a dummy that I just duplicate when I want to work with pages. Is there a way to create a new font style format so that you can just choose that style and get your settings? I just don't see how its possible that there is not a way to edit the default settings in pages...

    Folders & file management is a function of OS X. Here is an Apple video tutorial on using Finder in OS X.

  • Different paragraph styles within a text thread

    Does anybody know if it's possible to apply a different paragraph style to each text box in a text thread? I have three boxes: the first and the last have a small font and I'd like the middle one to have a larger font size.
    If it's not possible, is there an alternative way to do this?
    Thanks,
    Nacho

    Offhand i'd say that what Nacho wants to do will entail having separate text boxes...
    Seems to me that what he's doing is having the text flow from one box to another (column?). Obviously, changing / editing content will cause the text to shift its position.
    Nacho, i think you'll have to do one of the following:
    1/ Manually adjust the font style for the box you want each time you mke a correction
    or
    2/ Set up different, independent boxes (text areas) and style the box the way you want. Obviously changing text will mean changes in the area used by that box...
    Maybe someone else here can help out with a better suggestion...

  • Why does stuffit open and create a new folder every time I save a pages document?

    Why does stuffit open and create a new folder every time I save a pages document?

    Because you are saving it to the desktop, Pages documents are actually zipped files and Stuffit is set to uncompress desktop files.
    Either don't save to the desktop (bad practice) or check the preferences in Stuffit to see if you can turn off unstuff files on desktop.
    Peter

  • What is the best practice for creating master pages and styles with translated text?

    I format translated text all the time for my company. I want to create a set of master pages and styles for each language and then import those styles into future translated documents. That way, the formatting can be done quickly and easily.
    What are the best practices for doing this? As a company this has been tried in the past, but without success. I'd like to know what other people are doing in this regard.
    Thank you!

    I create a master template that is usually void of content, with the exception I define as many of the paragraph styles I believe can/will be used with examples of their use in the body of the document--a style guide for that client. When beginning a new document for that client, I import those styles from the paragraph styles panel.
    Exception to this is when in a rush I begin documentation first, then begin new work. Then in the new work, I still pull in those defined paragraph and or object styles via their panels into the new work.
    There are times I need new styles. If they have broader applicability than a one-off instance or publication, then I open the style template for that client and import that style(s) from the publication containing the new style(s) and create example paragraphs and usage instructions.
    Take care, Mike

  • How do I change the default paragraph style from Body Text?

    The default paragraph style in my email setup is Body Text. This does not wrap properly for some recipients, but Paragraph does. How do I change the default so that Paragraph is automatically used when I start a new email?

    There are two types of defaults: defaults for all new documents and defaults for the current document. To change the default for any open document make sure no text frame is active and change the formatting as desired in either the Control panel or the Character and Paragraph panels. To change default formatting for new document (those not yet created) do this while no file is open. You can’t change the defaults for several documents at once without a script.

  • How to handle paragraph styles in imported text with no tagged paragraph styles

    Hi
    Im currently trying to import a file (word file / excel I have both formats) into an indesign book and formatting the text automatically!
    My question is: How is it possible to reflow text into frames and when changing frame it changes paragraph?
    Or how is it possible to change paragraph style when forcing a line break when using text reflow?
    I have already figured out how to reflow the text, and actually also managed to relow text into the frames and change paragraph style. I know how to use the keep option, and by this change the paragraph style when e.g. changing frame break/page break etc.  (but if the content being flowed-in is not tagged with style names then I cannot figure out how to do it) The document and its content I whish to import do not have any tagged paragraphs!
    Then I tried to look into "object styles" and format a text frame on a master page with an object style, and by using a "dilimiter character" forcing the text to start in a new frame when bringing the frame into live on a page. But here I cannot make the "text frame/object style" to apply or to work.
    If any of you have a hint, I would be more than happy to hear from you
    This picture are illustrating the outcome I would to get to....

    If the incoming text does not have styles, or has only one style, there is really not much you can do other than assign styles after the import. If there are recognizable patterns in the formatting, a lot of that can be done with Find/Change, and there are a few scripts floating around that can help automate some of that.
    Also, if your styles have a a good "next style" heirarchy built in, you can select large blocks of text (up to the point where applying next style would be incorrect), then right click the style name in the paragraph styles panel and choose apply style and next style (remove overrides). Warning. Removing overrides will remove any locally applied formatting like bold or italics, so local formatting should be converted to character styles first. Applied character styles are not overrides and will be preserved.

  • Is there a script to change paragraph style based on even/odd page

    Is there a script or way to have paragraph style change between 2 styles based on the text being on an even or odd page? 

    @JustMikey – as I understand your task, the problem has nothing to do with "special" paragraph styles, but (nearly) all with anchored objects (the images and parts of the gray bar) and appropriate margin settings.
    Just see the following IDML file I exported from InDesign CS5.5:
    Dropbox - ImagesAwayFromSpine-CS5.5.zip
    ImagesAwayFromSpine-CS5.5.zip
         ImagesAwayFromSpine-CS5.5.idml
         080731_Manchester-xxl_Grau.tif
    Of course you could add paragraph styles to format the data automatically or optimize in other ways.
    That's up to you. But you can see the principle:
    Inspect the Anchored Object Options for the image and the gray bar. Also the frame fitting options for the image.
    Note: See also the margin settings, that are not exactly mirrored on even and odd pages (for good reason).
    Uwe

  • [CS4 JS] Find a paragraph style and get text contents

    Hello,
    I would like to get to contents of text that is applied with a specific paragraph style, so that I can copy it to another text frame
    app.findTextPreferences = app.changeTextPreferences = null;
    app.findTextPreferences.appliedParagraphStyle = "headline";
    // and then get the value/contents of that applied paragraph style
    Sjoerd

    Something like this:
    str = "";
    found = app.activeDocument.findText();
    for (i = 0; i < found.length; i++)
       str += found[i].contents;
    "str" now contains aal text styled with that paragraph, which you can now save in a text file.
    Peter

Maybe you are looking for

  • Uploading of material master data using bapi BAPI_MATERIAL_SAVEDATA

    hi guys, i am uploading data from a flatfile (say notepad file). the value for the field BRGEW(gross_wt) is displayed as 0.0000 WHEN i run the transaction MM03 where as  in the flat file its value  is 0000000000003 the data type of BRGEW is P what sh

  • How do I get the app to install with Configurator?

    Trying to set up a few iPads with all the same apps etc.  Have a VPP account (just started in Canada, whoot!), have purchased the apps, have the spreadsheets. Instructions for Configurator say to import the app, and then later when installing the app

  • Can you reinstall OS X Mavericks without losing data

    I think something happened to my operating system.  I had to reset all permissions using the disk utility and now somethings just don't work right.  For example:  I can open system preferences, and when I click on iCloud, it says "loading" and then h

  • Setting up an 8 post (4 pair) wall plate with my VIZIO LCD HDTV

    I just bought a E420VL VIZIO HDTV and I want to set it up with my existing built in home speaker system. What is the best way to do this? Solved! Go to Solution.

  • Exclusive and Group Condition

    Dear Gurus, In MM what is meaning of Exculsive in Aceess sequence and How is the use of Group Condition in condition type please explain me in simple . Regards, Pooja Panday