Delete and substitute another paragraph styles...

Hi everyone,
We need script for delete unwanted paragraph styles & character styles in InDesignCS2. While deleting also want to replace some styles for it. So can anyone help me for this. Thanks.
Thiyagu

I found this script hoping it would help me out. We recently updated the template to one of our books so the paragraph & character style names line up with other projects. I added two lines to the script in the format shown and ran the script and it worked. "Great!" I thought. But when I made a comprehensive list (the script is 47 lines long), it suddenly gives me error messages and won't even get through one line of the script! I have confirmed that both the old and new style names are present in the document and match exactly. Can anyone help me understand what I'm doing wrong? I've attached the warning message and a few lines of the script. I am working in CS4. Thanks,
Matt
var myDocument = app.activeDocument;
myDocument.paragraphStyles.item("Body - Recipe Head").remove("STORY HEAD");
myDocument.paragraphStyles.item("Body - Recipe Head 2 line").remove("STORY HEAD 2LINE");
myDocument.paragraphStyles.item("Body-Recipe Head 3 lines").remove("STORY HEAD 3LINE");
myDocument.paragraphStyles.item("Body - Indent").remove("STORY BODY");
(continues this pattern for other styles)

Similar Messages

  • Can't edit Padding (in Borders and Shading) for paragraph style in .CSS

    Can someone please explain why I can't define the padding of
    a solid box when editing paragraph styles of a .CSS?
    Running RH 7.02.
    I can edit the padding if I select the style from within a
    topic. When I attempt to edit the style in a .CSS, the Padding
    button is disabled.

    At least it's comforting to know it's not just me ...
    From this discussion, apparently it's not a bug:
    https://discussions.apple.com/message/23578594#23578594
    "Some titles cannot be edited"
    Grrrrrr

  • Apple id - delete on iphone and substitute another existing account

    I have multiple apple id's. the one on the iphone goes to a me.com email and to a non functioning e-mail address and one of thesecurity questions is wrong in apples records
    I want to delete the me id and replace it with my other account.
    Help
    jim

    Settings > Store > tap ID > sign out > sign in with new ID.

  • 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

  • Does deleting paragraph styles affect documents which used a deleted style?

    Assume you have a web page or site made with paragraph styles.
    You start a new page in that site but decide to delete a bunch of paragraph styles which you  no longer want
    The style should be in the html of the earlier documents and deleting the style should not delete the existing HTML.
    But with Muse you never can be sure.
    So is it ok to clean up the clutter and delete a bunch of old styles when creating something new or not?
    Please do not respond unless you actually know the answer. No guesses please.

    Hi Jkijki,
    If you have created a paragraph style and applied to a paragraph, when you try to delete that paragraph style you will get option to replace the paragraph styling with another style (if there exist any):
    Check this link: http://prntscr.com/3p9c5x
    Regards,
    Gaurav Aggarwal

  • I need help writing a script that finds the first instance of a paragraph style and then changes it

    I need help writing a script that finds the first instance of a paragraph style and then changes it to another paragraph style.  I don't necessarily need someone to write the whole thing, by biggest problem is figuring how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thanks!

    Hi,
    Do you mean first instance of the paragraph style
    - in a chosen story;
    - on some chosen page in every text frames, looking from its top to the bottom;
    - in a entire document, looking from its beginning to the end, including hidden layers, master pages, footnotes etc...?
    If story...
    You could set app.findTextPreferences.appliedParagraphStyle to your "Style".
    Story.findText() gives an array of matches. 1st array's element is a 1st occurence.
    so:
    Story.findText()[0].appliedParagraphStyle = Style_1;
    //==> this will change a paraStyle of 1st occurence of story to "Style_1".
    If other cases...
    You would need to be more accurate.
    rgds

  • 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

  • Multiple paragraph styles in one line

    I'm creating a training manual and I am having trouble with paragraph styles. Here's an example of what I am trying to do:
    "The Dog walks up the hill"
    In the above example, I have created a style for the bolded text and connected it my table of contents. The idea is when I create and update the TOC, "The Dog" will be the entry with the remaining text omitted from the TOC. The issue I am having is because the text is on one line, I cannot have multiple styles. I've tried writing just "The Dog" and then either changing the style or deleting the paragraph break to connect the text below to the main line. Once I erase the paragraph break and the text is on one line, only ONE style is maintained. Now, I can modify the character style; however, because the paragraph style is still the one connected to the TOC, the entire paragraph appears in the TOC.
    Any advice would be greatly appreciated! I've searched everywhere to no avail.
    Thank you very much for your support.

    ajmiddle18 wrote:
    I'm creating a training manual and I am having trouble with paragraph styles. Here's an example of what I am trying to do:
    "The Dog walks up the hill"
    In the above example, I have created a style for the bolded text and connected it my table of contents. The idea is when I create and update the TOC, "The Dog" will be the entry with the remaining text omitted from the TOC. The issue I am having is because the text is on one line, I cannot have multiple styles. I've tried writing just "The Dog" and then either changing the style or deleting the paragraph break to connect the text below to the main line. Once I erase the paragraph break and the text is on one line, only ONE style is maintained. Now, I can modify the character style; however, because the paragraph style is still the one connected to the TOC, the entire paragraph appears in the TOC.
    Any advice would be greatly appreciated! I've searched everywhere to no avail.
    Thank you very much for your support.
    It depends on the breed of dog.
    Is the paragraph always a single line?
    Is this dog the leader of the pack? IE, does the phrase you want to keep always begin the paragraph? If so, then you can separate the dog from the pack in the TOC. One way is to surround the pack with a unique character or marker in the main text, like End Nested Style Here, - one after dog, and another after hill, and create a paragraph style for the doggie paragraph to use in the TOC. This paragraph should contain a nested character style that applies microscopic text properties, like paper character color, font .1pt, and horizontal scale .1%. The TOC entries should use nested paragraph styles; the source paragraphs need you to insert the End Nested Style Here markers. The nested style definition in the TOC paragraph styles should apply no character style through the first end nested style marker, then apply microscopic through the next end nested style marker. This will shrink the walks...hill text to an invisible speck, so small that it shouldn't interfere with tab leaders and page-references.
    Another approach is to use a single-row table for the heading, with the dog pent nicely in the left cell, and the pack in the right cell. Each cell contains a paragraph, so only extract the dog to the TOC.
    Search Google for terms like "InDesign hide part of paragraph in toc knowhowpro," "InDesign suppress part of paragraph in contents knowhowpro," "InDesign two paragraph styles on one line," and similar phrases without quotes for some good discussions and a variety of approaches that include layers, anchored frames, and conditional text.
    Search Google for terms like "InDesign conditional text," and "InDesign nested paragraph styles," without quotes for details.
    http://forums.adobe.com/message/3206266 has a long discussion that may shed some additional light.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • I would like to know how to include entries in my TOC that refer to paragraph styles that a before the TOC.

    I would like to know how to include entries in my TOC that refer to paragraph styles listed before the TOC.
    Example:
    page i. Title Page
    page ii. Abstract
    page iii. Table of Contents
    I want the TOC on page iii to include the entries "title page" and "abstract". Is this possible?
    Thank you-

    Thesis formatting rules.
    Can you answer another question?
    How do I change the text for a TOC entry? For example,
    I have selected the title on my first page, for example "Summer Report" and selected a paragraph style for it, and added it in the TOC. Now the TOC will have this entry for "Summer Report" and the associated page. But I want it to say "Title Page" instead. Can I edit this text? In order words, have the TOC point to something with whatever name I want to give it, even though it is not the actual name of the section?

  • Multiple paragraph styles within one cell?

    Maybe I'm missing something real simple but I'm having a bit of an issue with styles.  What I'm trying to do is have the name of a tool in one paragraph style and the description (separated from the name by "-") in another paragraph style - all within the same cell of a table.  Instead, when I try to change styles it changes all text within the cell.  Even if I go back and highlight the tool name and change it to a different style than the description it changes all text including what is not highlighted.  If anyone has a solution I would greatly appreciate it!

    Thanks, Dave!  Nested styles works perfectly.  I figured the solution would've been something simple like this.

  • Changes to [No Paragraph Style] causing unwanted style overrides

    Hi fellow InDesigners
    I'm using InDesign CS6. I'm working with long documents that were originally created in previous versions (CS4 and possibly earlier). My standard workflow for these jobs is to do the bulk of the text formatting in a newly created, bare-bones, single column document. First, I load the paragraph and character styles from the template, and when I'm done I copy and paste the formatted text back into the template for final layout and typesetting. This used to work fine in CS4, but in CS6, all my paragraphs show the plus sign in the Paragraph Styles panel, indicating that they have been overridden. They should be identical, since I imported the styles from one file to the other. The overrides include drop cap alignment, and even more obscure things like 'IdeoSpaceBehavior' and 'Diacritic Positioning'.
    It seems likely to me that this problem is due to Adobe having changed the definition of the mysteriously ubiquitous '[No Paragraph Style]' style between versions. The template file has carried over the definition from CS4, but the newly created working files have the new definition, and since [No Paragraph Style] is not included when importing styles from one document to another, the inconsistency remains. Copying and pasting text with no overrides in one document, shows overrides in the other.
    So the simplest solution I can think of, would be to change the [No Paragraph Style] in the template to match the definition of new CS6 documents. Is this even possible? My Googling thus far suggests that [No Paragraph Style] is pretty much untouchable.
    Is there nothing for it but to create the template files again as new documents in CS6?

    No worries Michael. Yes, I vaguely remember the change too.
    My understanding is, [No Paragraph Style] is very much a style—a paradoxically named style to be sure, but a style nonetheless. Check out the [Basic Paragraph] style definition by double clicking on it in the Paragraph Styles panel. It's style definition is: '[No Paragraph Style] + next: [Same style]'. That's it. Minion Pro 12 point, with auto leading—and every other conceivable paragraph attribute—all handled by [No Paragraph Style]. Adobe needed some defaults, and that's what [No Paragraph Style] is—just a default style. You can never escape it either, since every style, no matter what it's based on, has [No Paragraph Style] as its most senior ancestor.
    So that's essentially my problem. Adobe has, in their wisdom, changed the [No Paragraph Style] style between versions, so that a document originally created in an earlier version and a document created in CS6 have different [No Paragraph Style] settings. I'm pretty confident this is the cause of my problems.
    Lots of my paragraph styles inherit from other styles. Why would I not want that? My custom 'Paragraph' style has lots of other styles based on it—from typesetting variations, to quotes, lists, etc. But the 'Paragraph' style itself is based on [No Paragraph Style]. As I said, you can't really escape [No Paragraph Style].

  • Clicking a Paragraph Style Does Not Apply Style to Text

    I just switched from a PC to a brand new MacBook Pro (OSX Lion 10.7), and I bought InDesign CS5.5. I have been using CS4 on a PC for a couple of years and had no issues. For some reason, I cannot apply Paragraph Styles by placing my cursor in the text and clicking the Paragraph style. It highlights the clicked style for a moment, and then de-highlights all the styles, but does not apply any changes. The only way I can apply a Paragraph Style right now is by right clicking the style and selecting "Apply..." from the drop down menu. It's very puzzling. I was wondering if anyone had any experience with this. I also have Microsoft Office: Mac 2011 installed on the laptop if that makes a difference to anyone. Any help would be greatly appreciated, since I typeset and edit for my living, and this problem is slowing me down a bit.

    Neither. Let's say I click into a paragraph. The current style will be highlighted. If I click on another style (or even attempt to re-apply the same style by clicking on it in the styles pane), it momentarily highlights the new style, then flashes a little bar underneath (like the one that shows up if I were to try to re-organize the styles list by dragging a style to a different pace in the styles list), then all the styles become unselected, but no changes have been applied to the paragraph in question. Very definitely not normal. It is almost as if the pane assumes that I am attempting to drag the style even when I am merely clicking on it. Very weird.

  • JS Accessing the Paragraph Styles Panel Menu?? PLEASE HELP!

    I haven't heard anything yet about this topic, can anyone help me?
    Hi all,
    I'm hoping you can help me with is, I'm about to tear my hair out! I'm using JavaScript in InDesign CS3 (PC). I have three heading scripts that I wrote that go through a series of actions when clicked, and I need to be be attached to the appropriate paragraph styles. This is so the user will receive a certain look and feel when they click the style, but they won't know a script ran at all, they'll think it's just another paragraph style.
    I ran the menu id script from the InDesign Scripting Guide, and it says that the root ID should be "Paragraph Style Panel Menu", however, that is not working. HELP! How can I get InDesign to reference the existing Paragraph Style Panel Menu?
    THANK YOU! Code below:
    myDoc = app.activeDocument;
    var setpath = "~/Application Data/Adobe/InDesign/Version 5.0/Scripts/Scripts Panel/";
    var myScript1 = new File(setpath + "Heading 1.jsx");
    var myScriptAction1 = app.scriptMenuActions.add("InD - Heading 1");
    var myEventListener1 = myScriptAction1.eventListeners.add("onInvoke", myScript1, false);
    var myScript2 = new File(setpath + "Heading 2.jsx");
    var myScriptAction2 = app.scriptMenuActions.add("InD - Heading 2");
    var myEventListener2 = myScriptAction2.eventListeners.add("onInvoke", myScript2, false);
    var myScript3 = new File(setpath + "Heading 3.jsx");
    var myScriptAction3 = app.scriptMenuActions.add("InD - Heading 3");
    var myEventListener3 = myScriptAction3.eventListeners.add("onInvoke", myScript3, false);
    try{
    var myScriptMenu = app.menus.item("$ID/Paragraph Style Panel Menu");
    myScriptMenu.title;
    catch (myError){
    var myScriptMenu = app.menus.add("$ID/Paragraph Style Panel Menu");
    var myScriptMenuItem1 = myScriptMenu.menuItems.add(myScriptAction1);
    var myScriptMenuItem2 = myScriptMenu.menuItems.add(myScriptAction2);
    var myScriptMenuItem3 = myScriptMenu.menuItems.add(myScriptAction3);

    K Jane wrote:
    "How can I get InDesign to reference the existing Paragraph Style Panel Menu?"
    var myParagraphStyle = myDoc.paragraphStyles.item("myParaStyelName");
    Is this what you are after? Don't know how it relates to your sample code though.
    Brett

  • Selecting a paragraph style

    Hi All,
    I am working on InDesign CS3, I am looking for an API/Command using which I could select a paragraph style.
    I am elaborating my problem as follows
    In paragraph style palette we have a default paragraph style called "Basic paragraph"
    I have created another paragraph style say "Paragraph Style 1"
    Now I want to select "Paragraph Style 1" as a default style for the newly created story
    If anybody knows about this then please help me
    Thanks and Regards,
    Alam

    We can any style to default style by processing kDefaultTextStyleCmdBoss

  • How do I show table paragraph styles in keynote 6.1 (mac)?

    Hi community,
    I am tryying to apply changes to paragraph styles in keynote 6.1 (mac). But in the list which opens when i click in the triangle only the basis paragraph styles are seen.
    Any ideas how and whre i can find theses styles.
    Thanks
    slyrs

    I am sorry that I cannot make myself clear - perhaps because of my language competence
    1) There is a table style (for the whole table)
    And there are PARAGRAPH-styles for the text-attributes of the text in the table-cells (bold, italic, size, font etc.). I would call this a paragraph-style. This can be seen here:
    But this style cannot be edited or changed because it does not show up in the dropdown of the parapgrah-styles - as can be seen here:
    You DO NOT FIND the paragraph-style ("Absatzstil" in German) "Tabellenstil 1" in the dropdown.

Maybe you are looking for

  • Zen Vision:M Recognition Prob

    I am using WMP, XP SP2, and every time i try to connect the Zen to the Computer it Recognizes it, Says found a new MTP Device, and trys to install the drivers for it. Every time Windows trys to install the drivers I get an error that says the system

  • I can no longer run itunes since the latest update

    i can no longer run itunes since the latest update

  • Mandatory Views and Fileds for Material Types

    Hi We require the below, Whr can i get this. If any one hv the below requ pls sedn to this srcn dot ram at hot mail dot com The requ is we need to know wat are all the mandatory views and mandatory fileds for all std material types provided by SAP. W

  • Prime 4.2 Telnet/ SSH Connections to Switches

    Hi everybody, I have a problem with LMS 4.2 and use Telnet/ SSH tool to open network devices. If I start the tool telnet/ssh, always starts a telnet session and no ssh session. But telnet is disabled on all devices in my network. Can I change somethi

  • Is it possible to play Sculpture using my Roland GR-55 synth?

    I'm connecting the CakeWalk UM-1G MIDI USB Interface to connect my Roland GR-55 Guitar Synth to Logic Pro 9.1.7 with the purpose of controlling or being able to access the sound capabilities of Sculpture and record them as audio tracks. Can anyone sh