Change any paragraph style by script

Hi !!!
Is it possible change a selected paragraph with any paragraph style by script?
Example:
My paragraph style is:
Font: Garamond, size 7pt, color: black, align justfy (or any selected paragraph style)
Script to set the selected paragraph with paragraph style describe above to:
Font: Humanist, sise 8pt, color: black, align justfy
Drop caps: number of lines: 3, one or more caracteres: 2

I got it.
But there is a trouble.
How can I change into this script the first caracter dropcaps to fill tint 30% Black?
var myPara = app.selection[0].paragraphs[0];
var myChar = myPara.characters[0];
myPara.dropCapCharacters = 1;
myPara.dropCapLines = 2;
myPara.dropcapDetail = 1;
myPara.firstLineIndent = 0;

Similar Messages

  • [JS] How to break link to paragraph style from script?

    I don't found the command break link to paragraph style from script.
    I want "unapply" the style from the text, but leave the formatting intact.
    Can help me?

    In the interface it's a separate command ("Break link to style"), but it seems in a script you have to use
    Paragraph.applyParagraphStyle (using:ParagraphStyle[, clearingOverrides:bool=true])
    You cannot use "null" or something similar for "ParagraphStyle", so I guess the idea is to use paragraph style #0 in your document (which is always "[No Paragraph Style]"). Be sure to set "clearing Overrides" to false, as it defaults to true.
    The following single line works on your current paragraph:
    app.activeDocument.selection[0].paragraphs[0].applyParagraphStyle (app.activeDocument.paragraphStyles[0], false);

  • [AS] How to change a paragraph style within any folder in Find Grep?

    I want to change both text and paragraph style
    I do that job very easily until I put paragraph styles in a folder
    How to express the paragraph style "passage" within the folder "1st" in AppleScript?
    In line 18 below, "1st:passage" may be wrong... so I've tried and search for an hour, but I can't get the answer..
    sorry for bad english
    my main()
    on main()
      mySnippet_test()
      myTeardown()
    end main
    on mySnippet_test()
              tell application "Adobe InDesign CS5.5"
                        set myDocument to document 1
                        set find grep preferences to nothing
                        set change grep preferences to nothing
                        set include footnotes of find change grep options to false
                        set include hidden layers of find change grep options to false
                        set include locked layers for find of find change grep options to false
                        set include locked stories for find of find change grep options to false
                        set include master pages of find change grep options to false
                        set find what of find grep preferences to "\\n"
                        set change to of change grep preferences to "\\r"
                        set applied paragraph style of change grep preferences to "1st:passage"
                        tell myDocument
      change grep
                        end tell
      --Clear the find/change preferences after the search.
                        set find grep preferences to nothing
                        set change grep preferences to nothing
              end tell
    end mySnippet_test
    on myTeardown()
    end myTeardown

    Replace the red line with… Replacing name strings to yours…
    set myStyle to paragraph style "Style A" of paragraph style group "Style Group 1" of myDocument
    set applied paragraph style of change grep preferences to myStyle

  • Detailed font change in paragraph styles

    Hi there,
    I have a script to change font A to font B in all the Paragraph Styles used in a document, but is there a way of going a bit further with it?, so;
    Change font A "Bold"
    to         font B "SemiBold"
    Change font A "SemiBold"
    to         font B "Regular"
    Any help at all on this one would certainly help me out.
    Cheers,
    Littlemookie

    Yes, these lines should be plugged in into the little script from a while ago.
    for (var i=2; i<app.activeDocument.paragraphStyles.length; i++)
      if (app.activeDocument.paragraphStyles[i].appliedFont == "Arial\tBold")
        app.activeDocument.paragraphStyles[i].appliedFont = "Myriad Pro\tSemibold";
    's all. Change font names where required.
    Duhh, I'm not very good at this!
    At some point in time, neither was I. I just happen to know this area of scripting, others are as unclear to me as well. "Practice" and all ;-)

  • [JS CS3] Find/Change "[Basic Paragraph]" style

    I'm trying to find all occurances of the [Basic Paragraph] style and replace them with [No Paragraph Style]. I'm using:
    app.findTextPreferences.appliedParagraphStyle = "[Basic Paragraph Style]";
    app.changeTextPreferences.appliedParagraphStyle = "[No Paragraph Style]";
    I get the message "Invalid value for set property 'appliedParagraphStyle'. Expected String, ParagraphStyle or NothingEnum enumerator, but received "[Basic Paragraph Style]"."
    I've tried every combination of brackets, no brackets, quotes, no quotes, etc. It doesn't seem like this can be scripted, even though it can be done via find/change in InDesign. Am I banging my head against the wall? Does anyone know if this can be done?

    "[Basic Paragraph]" as shown in the code below doesn't work either. (the word "Style" actually snuck in as I was trying different variations. But no combination seems to work.
    If anyone knows that [Basic Paragraph] can or cannot be accessed via scripting, I'd like to know. Thanks.
    app.findTextPreferences.appliedParagraphStyle = "[Basic Paragraph]";
    app.changeTextPreferences.appliedParagraphStyle = "[No Paragraph Style]";

  • PAGES: How change a Paragraph Style ?

    Hello all,
    there is something that is driving me crazy...
    using Pages for iPad is it possible to change the default settings of a Paragraph Style ?
    I am not talking about importing a document with a custom set of styles but simply:
    - I open my document in Pages for iPad
    - I select a line of text and apply the "Header 1" style to it
    - I am not happy - for example - with the font size of the Header 1 style and I want to make all my Header 1 paragraphs change their font size
    - In the desktop version you would simply change/update the style you need, but on the iPad I cant find a way to change those values
    (BTW, I seem to remember that I once managed to do this...)
    Thanks,

    You seem to be able to copy and paste styles, but nowhere that I can find does it let you update the defined styles.
    There is the manual which does not refer to any suitable method, and also some eBooks on the subject but I have scanned those and can find no reference to redefining styles either.
    The more I play with Pages for iPad the more of a toy it seems. Sort of amazing that it does what it does on a mobile tablet, but when you get right down to it, not very useful.
    Peter

  • Pages for iPad: change a Paragraph Style ?

    Hello all,
    there is something that is driving me crazy...
    using Pages for iPad is it possible to change the default settings of a Paragraph Style ?
    I am not talking about importing a document with a custom set of styles but simply:
    - I open my document in Pages for iPad
    - I select a line of text and apply the "Header 1" style to it
    - I am not happy - for example - with the font size of the Header 1 style and I want to make all my Header 1 paragraphs change their font size
    - In the desktop version you would simply change/update the style you need, but on the iPad I cant find a way to change those values
    (BTW, I seem to remember that I once managed to do this...)
    Thanks,

    You seem to be able to copy and paste styles, but nowhere that I can find does it let you update the defined styles.
    There is the manual which does not refer to any suitable method, and also some eBooks on the subject but I have scanned those and can find no reference to redefining styles either.
    The more I play with Pages for iPad the more of a toy it seems. Sort of amazing that it does what it does on a mobile tablet, but when you get right down to it, not very useful.
    Peter

  • Change default paragraph style!!

    How do I change the default paragraph style? I can't stand double spaces but that's what I am stuck with
    I want freeform, not body
    Application is Pages 2.0.2
    Message was edited by: Spprrw

    Welcome to the Apple forums
    By default, the Pages developers chose to use 12 point after paragraph spacing which will make it appear as a double space between paragraphs. You need to create your own default template. Set up your document with the line spacing, margins, headers, etc. as you'd like. Redefine all of the paragraph & character styles to have your desired font.
    While you're at it, you might want to set default styles for all objects, text boxes, tables, paragraph styles, etc. Start with a blank document & insert an object. Change the color, wrap, etc. to your choosing & then go to Format > Advanced > Define Default Shape Style then delete the object. Repeat with an image/photo, a text box & a table.
    Now, save this as a template then, in Pages > Preferences, select this template as the default for new documents. All of your new documents will have these settings for inserted objects, images & tables. Unfortunately, the settings won't apply to any other templates or "foreign" documents you open with Pages.

  • FIND/CHANGE - Applying Paragraph Style

    Hello,
    I used FIND/CHANGE to apply my paragraph style and when I apply the paragraph style... it applies the style to the entire line.
    For example,
    A. #70712       resulted to         A. #70712
    I only wanted the "#70712" to be changed to my style. I used the GREP search and entered #.+ and then I choose the paragraph style I want and clicked change all. The problem is that it changed all the text on that line and applied the paragraph style.
    Please help. Thank you very much.

    graphicsoc wrote:
    Hello,
    I used FIND/CHANGE to apply my paragraph style and when I apply the paragraph style... it applies the style to the entire line.
    For example,
    A. #70712       resulted to         A. #70712
    I only wanted the "#70712" to be changed to my style. I used the GREP search and entered #.+ and then I choose the paragraph style I want and clicked change all. The problem is that it changed all the text on that line and applied the paragraph style.
    Please help. Thank you very much.
    If I understand your request correctly:
    If your paragraph style uses a numbered list to create the "A." and the remainder of the paragraph consists of only "# 70712" that you type in manually (or place from an existing file), I believe that you you don't need GREP. You can format the auto-numbered list differently from the remainder of its paragraph, by specifying a character style for the number portion.
    To extract only the non-numbered portion of an auto-numbered paragraph, for a TOC, in the Table of Contents dialog box, open the bottom part by clicking More Options if necessary, and in the Numbered Paragraphs pull-down menu, select Exclude Numbers.
    Read more about Table of Contents in Help, and/or with a Google search for terms like "InDesign table of contents numbered list exclude numbers" without quotes.
    If you need additional special formatting "tricks" in the source paragraphs, or in the TOC entry paragraphs, look into Nested Styles and GREP
    Styles in Help or Google searches.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • How to change the paragraph style of every paragraph that only contains an anchored object?

    Hi,
    I have a document in word that needs to be converted into indesign. The document containts instructions, each step followed by an image.
    I've managed to import the document into Indesign, and applied a paragraph style with numbering to everything (text an image).
    Now, how to change the the paragraph style of every paragraph that only contains a image? I need to get rid of the numbering.
    Thanks in advance.

    Create two Paragraph Styles and name them Image and Non-Image. Apply the paragraph styles manually to the text containing image and not containing images.

  • Find and change last paragraph style

    With .js or grep, I want to change the style of the last bullet paragraph to one with more space after, there are many of them in one story mixed with other styles.
    Change this:
    blarr blarrblarr (bullet style)
    blarr blarr blarr blarr (bullet style)
    blarr blarr change this one (bullet style)
    To this:
    blarr blarrblarr (bullet style)
    blarr blarr blarr blarr (bullet style)
    blarr blarr change this one (last bullet style)
    Can this be done? If anyone can help, it would be great!
    Many thanks!

    I reckon this JavaScript does the job. You might have to change the style names to match yours. Also, it assumes that the styles aren't grouped in a folder.
    //DESCRIPTION: Fix last bullet paragraphs
    (function() {
         if (app.documents.length > 0) {
              findFixLastBullets(app.documents[0]);
         function findFixLastBullets(aDoc) {
              setupFindText();
              app.findTextPreferences.appliedParagraphStyle =  "Bullet";
              var myFinds = aDoc.findText();
              for (var j = myFinds.length - 1; j >= 0; j--) {
                  var lastPara = myFinds[j].paragraphs[-1];
                  // if next para already BulletLast do nothing
                  var nextPara = lastPara.insertionPoints[-1].paragraphs[0];
                  if (nextPara.appliedParagraphStyle.name == "BulletLast") continue;
                  lastPara.appliedParagraphStyle = "BulletLast";
         function setupFindText(find, change, wholeWd, caseSense, foots, hidLayers, lockedLayers, lockedStories, masters) {
         app.findTextPreferences = null;
         app.changeTextPreferences = null;
         try { app.findTextPreferences.findWhat = find } catch(e) {};
         try {app.changeTextPreferences.changeTo = change } catch(e) {};
         app.findChangeTextOptions.properties = {
              caseSensitive:(caseSense == null ? false : caseSense),
              wholeWord:(wholeWd == null ? false : wholeWd),
              includeFootnotes:(foots == null ? false : foots),
              includeHiddenLayers:(hidLayers == null ? false : hidLayers),
              includeLockedLayersForFind:(lockedLayers == null ? false : lockedLayers),
              includeLockedStoriesForFind:(lockedStories == null ? false : lockedStories),
              includeMasterPages:(masters == null ? false : masters)
    } // end setupFindText
    Notice the little touch that if the next paragraph is already BulletLast it ignores that found text. This allows you to run the script more than once if you add more text.
    Dave

  • How can I change the paragraph style of the Table of Contents entries themselves?

    From what I can see, all Table of Contents entries are the same font, size, indentation and layout when the book is viewed in Portrait mode on an iPad. I have long subheadings in my Table of Contents, and they get truncated!
    How can I modify the style definition of the TOC entries themselves so that they will display in a smaller font size with less indenting, etc.?

    Modifying the TOC: http://support.apple.com/kb/PH2752?viewlocale=en_US
    Have you tried altering the style of the default items on the TOC page?

  • Problem changing and creating paragraph styles in Pages

    When using paragraph styles I come up against several problems that I haven't been able to figure out with the help menu:
    1. When I change a para with the style list it doesn't change the para to the chosen parameters. It changes for instance the font but not the size. How do I make sure that the chosen text gets changed completely?
    2. When I want to create a new style from selection it does not create a style that turns up in future lists. I only get to choose what is already somewhere in the text I am writing and what seems to be a default list that shows up with every new document. To change to something else I have to find a text that has the format I want, copy a piece of it, put it into the text I am working on and then try and change the paragraph style. How can I make sure that I have the styles I want at my disposal whatever I am working on? Can I somehow edit the choices in the style drawer?
    3. When looking at the help menu, this is the beginning of an instruction:
    +To apply a style to one or more paragraphs, select the paragraphs you want to change, or select an entire text box, table, table cell, or shape that contains text. Click the Paragraph Styles button in the format bar, and then choose the style you want to apply+
    Now, where do I find the paragraph styles button and where is the format bar? I clicked my way through numerous drop down menus but haven't found what this is referring to.
    Would be grateful for any hints, and please keep your explanations simple enough. I need instructions for dummies Thanks in advance!

    ravenowl wrote:
    When using paragraph styles I come up against several problems that I haven't been able to figure out with the help menu:
    1. When I change a para with the style list it doesn't change the para to the chosen parameters. It changes for instance the font but not the size. How do I make sure that the chosen text gets changed completely?
    Double click on the style name in the styles drawer to completely force the style onto the selected text. This will however eliminate any bolding, italics, underlining etc.
    2. When I want to create a new style from selection it does not create a style that turns up in future lists. I only get to choose what is already somewhere in the text I am writing and what seems to be a default list that shows up with every new document. To change to something else I have to find a text that has the format I want, copy a piece of it, put it into the text I am working on and then try and change the paragraph style. How can I make sure that I have the styles I want at my disposal whatever I am working on? Can I somehow edit the choices in the style drawer?
    To add a style to the Styles Drawer, format your text, then click on the little red triangle next to the style in the drawer and choose New from selection giving it a name.
    You can also change the name of the style by right clicking on the name and selecting Rename. This is not always available as some names are reserved.
    Each document has its own definitions of the styles. You can import Styles from other documents:
    +Menu > Format > Import Styles… > Browse to a document with the styles and select those you want to copy over+
    3. When looking at the help menu, this is the beginning of an instruction:
    +To apply a style to one or more paragraphs, select the paragraphs you want to change, or select an entire text box, table, table cell, or shape that contains text. Click the Paragraph Styles button in the format bar, and then choose the style you want to apply+
    Now, where do I find the paragraph styles button
    It is the reversed blue P on the Toolbar, also +Menu > View > Show Styles Drawer+
    and where is the format bar?
    I assume you are referring to the toolbar at the top of the window.
    I clicked my way through numerous drop down menus but haven't found what this is referring to.
    Would be grateful for any hints, and please keep your explanations simple enough. I need instructions for dummies Thanks in advance!
    I suggest you download and read the Pages09_UserGuide.pdf under the Help menu.
    Peter

  • Why won't paragraph styles change?

    I opened a document from a few months ago and updated paragraph styles to a different font. However when I click on text and assign a style it has no effect. If I go to "basic paragraph" and click on that while holding down the option and shift keys, then it seems to remove whatever is stuck and then I can assign the style. But if I have to do this with every part of this 70 page document it is going to take a long time. Is there some way to make this go easier?
    The other thing is that I assigned keys to each style and I notice that even though I changed the paragraph styles to a different font the keys say they are assigned to the prior font, so maybe this is part of the problem.
    Suggestions very welcome.

    No.
    Break Link with Style does exactly what is reads.
    If you have a paragraph using the 'Body' style and you use the Break Link with Style option, then the paragraph retains the current appearance and settings, but is no longer associated with the 'Body' style. So, when and if you change the 'Body' style, that paragraph will not change.
    Clear Overrides reverts manual styling to the applied Paragraph Style. So, using the example above, assume your 'Body' style uses Myriad Pro Bold, and you manually change the font in a paragraph to Myriad Pro Black, that is an override. Selecting "Clear Overrides" reverts the font back to Myriad Pro Bold.
    Clear Overrides does not appear in the palette menu for character styles.
    Your text cursor needs to be active within the paragraph (or some of the text must be selected with the text tool) in order for the contextual menu to show the Clear Overrides option.
    Another option is to check the Paragraph Style Palette with the text cursor active in a paragraph. If there is any paragraph style applied, then it should appear bolded in the list. If there are any overrides applied, there should be a
    + at the end of the style name. You can then Control Click on the Paragraph style to see a list of options such as:
    Apply Style
    Apply Style, Clear Overrides
    Apply Style, Clear Character Styles
    Apply Style, Clear All
    HTH
    -mt

  • How do I change the paragraph format of paragraphs that comes before a list of bullets in one shot

    I receive word documents to convert to indesign files based on a template. I have a set of find and replace queries that do most of the work.
    The manual work I am doing is as follows:
    Changing the paragraph style of all body copy that comes before before bullets
    Changing the paragraph style of last bullets and last subbullets
    What is the simplest way of changing the paragraph styles of every body copy before a list of bullets.
    I am doing more and more of these on a daily basis and would REALLY appreciate some insight.
    Not sure if this can only be done in a script.
    Hope that made sense.
    Thanks.

    spktrm11 wrote: Thanks for the response. I already have established styles. I have a style for "last bullet" and one for "bullets before last". I am trying to do a find and replace so I don't have to individually change the paragraph style of every last bullet.  Document: Paragraph Text. (I want to be able to find this specific paragraph, which would be any paragraph before a bullet and change its style.)
    bullet text
    bullet text
    bullet text
    bullet text (I want to be able to find this specific bullet (bullet text) and replace it with (last bullet))
    Paragraph Text
    I want to avoid having to go through the document to change the style of every last bullet that i find manually. I would like to find (based on it's position - any bullet that is followed by a paragraph)
    Hope this makes more sense
    Have you considered following lists with a "paragraph after list" style, like your paragraph before list style? This might be more appropriate for authors to apply while they create content. The idea is that all list items use a single style, so that rearranging items within the list doesn't require retagging the first or last list paragraph to adjust space or numbering when the first or last item is moved into the list.
    If this is a common problem in your work, you might want to post a feature request for smarter paragraph styles that can detect whether they're first, last, or interior list items, and adjust their properties as appropriate to their position. You can post your request here: wish
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

Maybe you are looking for

  • Sql query/function problem??

    Hi , I have problems writing a difficult sql query, please help me I have a table t in which there are 50000 records the table has columns like create table t (MATCH_ID     NUMBER(4) NOT NULL, TEAM_ID NUMBER(4), PLAYER_ID     NUMBER(4), RUNS     NUMB

  • Batch Photo Keyword Editor

    Hi there, Mac newbie here, I've only had my mac for a month or so, but slowly getting up to speed with it. Does anyone know if there is any applications that enable users to batch edit keywords within images? I know iPhoto and Aperture perform such a

  • Error - 'Jump distance is too large'

    Hi all, Our application throws an error that 'Jump distance is too large' . Kindly let us know of the options available to set this right. The following blog wont help us as changes to existing complex code at this point of time will be erroneous and

  • OVM 3.0.3 error, "VIP in use: conflict detected" when ovs-agent starts...

    Edited the Server Pool to set a new pool master "ovm3", now when booting the previous pool master "ovm2", I get the following errors when starting ovs-agent [2012-04-06 07:14:36 9140] DEBUG (OVSRemaster:98) VIP in use: conflict detected [2012-04-06 0

  • MEGA 865 hdd problem

    I recently bought a mega 865 barebone. I'm actually using it now and everything worked out O.K. except for 1 thing, maybe someone can help. I bought a Maxtor black dimond SATA HD 160gb. 7200rpm but the system is only recognizing it to be 130gb , i kn