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

Similar Messages

  • Script to Change Paragraph Numbering

    Hi.
    I am really new to scripting (please don't hurt yourself laughing at my code below )  and need some help!
    The issue: The documents I author go through a translation process which takes the InDesign XML data and exports my text into a web browser tool so it can be translated. After it has been translated, the text is placed back into my document with the formatting and paragraph styles that it had when I exported it. That created a problem with Figure and Table captions as those paragraph styles have "Figure" and "Table" hardcoded into the paragraph style.
    Possible Solution: On page one of each document that is generated, I list the language of that document (for example "Russian"). I think I need to write a script that goes looks at the first page and if it has a language listed (in this case "Russian") then it replaces the paragraph numbering text with a defined text ("Рисуноk" is "Figure" in Russian).
    if ((app.documents.length != 0) && (app.selection.length != 0)) {
      myDoc = app.activeDocument;
      myStyles = myDoc.paragraphStyles;
      myStringList = myStyles.everyItem().name;
    // What im trying to do below: If page 1 contains text “Russian” then Change the “Figure Title” paragraph numbering style to “Рисунок ^#.” I am missing the page 1 text find function.
    var myPara = appliedParagraphfstyle;
    myPara.numberingStartAt: Рисунок ^#.
    I’m so lost!!!! Help! Screenshots below to show what im trying to achive. Thank you so much!

    Hmm, I think what you're after is "numbering expression" rather than "start at."
    "Start at" is the actual number it's going to assign, to either continue from the previous number or if you're hard-coding to always start at 1, for example.
    The expression is the form it'll take, with wording and spacing you're using as your format for these labels. In AppleScript, it'd be:
    set numbering expression of paragraph style "Figure Title" to "Рисунок ^#. "
    I don't know Javascript, but there must be something similar in the JS scripting guide.
    Hope that helps!
    Mary

  • 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

  • GREP for changing paragraph style?

    Okay folks, I have another one for all you smart people out there. I think GREP can be used to change formatting in the following instance, but I have no idea how to set it up.
    I have a very long document, essentially a phone book-type listing of names, phone numbers, addresses, well over 150 pages' worth. The paragraph styles are fairly simple, only two per listing. The name/phone number is bold with a right hand tab with leader dots to a phone number that is flush to the right side of the column. The following lines are flush left, not bold, but indented 6pts. I've placed the text file and assigned the entire thing the NameListing paragraph style. I'd like to use GREP to find the address lines and change them to the NameListingAddress paragraph style.
    Here's a screen shot to give you an idea. The left column is formatted correctly with both styles, the right column is "raw", all paragraphs formatted with the NameListing paragraph style.
    Is this an appropriate application for GREP? If so, how do I set it up to only change the paragraphs that "don't have tabs"? It would save me a crapload of time.
    THANKS again! --Dina

    If your intent here is to use the character style to trigger a variable, as I belive it is based on your other thread, you MUST apply the character style up to the first tab to pick up the text at the start of the paragraph. There are two approaches to automating the formatting after that, but it may be too late for you to be much help.
    In cases where every listing has the same number of lines it makes sense to use a unique paragraph style name (not necessarily format -- base on on another) for each lline and make it its own paragraph. Set up "next styles" to rotate through the list so each line is assigned the correct style based on the style of its predecessor. You get the rotation to sart over by making the first line style the next style for the last line. This works for manual entry and can be applied to an entire block of placed text in a single operation by selecting the text, then right-clicking the name of the first style to be applied and choose Apply <stylename>, Then Next Style.This ONLY works if you have exactly the same number of paragraphs in each listing.
    The other option is to use forced line breaks instread of paragraphs and use one style for the entire listing. Set a left indent and negative first line indent, create a character style for the part of the first line that you want to appear in your header and apply it Up To ^t^n (that's a little-known trick -- if you enter more than one character in the trigger for a nested style it will activate on the first instance of any of the characters listed that occurs, so for example if you enter the word cat, your style will end on the first, c, a or t that appears inthe paragraph. ^t is the metacharacter for tab, and ^n is for forced line break) so that the style will end at either the tab, if present, or the forced line break if there is no tab (if you use a right-indent tab instead of a regualr right aligned tab [tricky to do a leader, but that's another discussion] substitute ^y for the ^t), then add a nested Line Style for one line. That line style should use a second character style that is based on the first character style you created for the name text and has no other attributes if you want the line to be the same from end to end. Sounds more complex than it is, and will work for listings with variable lenghths. The trick is to repalce your paragraph returns with forced line breaks, and will require a little thinking.
    If using separate paragraph styles for each line, you'd use the same technique of a nested style up to a tab for the first line, but there is no need to get fancier since it will apply to the whole line if there is no tab. The paragraph style, in this case, would carry all of the bold and size formatting (and no need for any indents), and the character style would be nothing more than a name that will allow you to use it in the variable.

  • Change paragraph style from X to Y in Pages Doc

    Hi
    Sorry for such a simple question, but I have looked through the Applescript manual and searched this forum and can't find a solution to my problem.
    All I want to do is loop through the paragraphs of a Pages document and if the paragraph style is "Body Full", then change it to "Body Half". I have tried if statements repeat statements and everything I can think of but can't seem to get it to work. I can loop through all the paragraphs and change them to "Body Half", but as soon as I try to select only those whose paragraph style = "Body Full" it doesn't change any.
    Here is an example of my attempt:
    tell front document of application "Pages"
    repeat with X from 1 to count (get paragraphs)
    if paragraph style of paragraph X = "Body Full" then
    set paragraph style of paragraph X to "Body Half"
    end if
    end repeat
    end tell
    If anyone could help I would be grateful. It's kind of embarrassing since I was a programmer for many years on mainframes and AS/400. Scripting is a new world to me.
    Thanks in advance.
    Jim

    Hello
    Jim Kahler wrote:
    I am also using iWorks 09. Now the indent level sets all paragraphs to the indent level of wherever the insertion point was when I ran the script.
    ? Still confused, it looks so easy!
    Jim
    Ok, i understand.
    Here is the solution :
    tell front document of application "Pages"
    set sel to selection
    set search_style to paragraph style "Body Full"
    set new_style to paragraph style "Body Half"
    repeat with X from 1 to count paragraphs
    tell paragraph X to if its paragraph style = search_style then
    select character 1
    set Y to indent level
    set its paragraph style to new_style
    set indent level to Y
    end if
    end repeat
    select sel
    end tell

  • [JS, CS2] Find Text - Change Paragraph Style

    I have text supplied to me formated with <g>,< b>,<k> or <r> at the start of paragraphs, this represents different paragraph styles that need to be applied. <br /><br />I started a script below, but it comes up with an error at "app.findTextPreferences.findText" <br /><br />have a used the wrong function here? <br />Is there an easy way for it to run through all of them as well, or should I just repeat this script with < b>,<k> and <r><br /><br />var myDoc = app.activeDocument;<br />var greenBullet = ["<g>", "<g>"]<br />replaceGreen();<br /><br />function replaceGreen() {<br />for (i = 0; i < greenBullet.length; i++) {<br />            var myGreenArray = greenBullet[i];<br />            app.findTextPreferences.findText = myGreenArray[0];<br />            app.changeTextPreferences.changeTo = myGreenArray[1];<br />            app.changeTextPreferences.appliedCharacterStyle=myDoc.characteerStyles.item("OFI Body copy_GREEN BULLET");<br />            myDoc.changeText();<br />            }<br />}

    Thanks Dave!<br /><br />OK, Now I am getting this message when I run it:<br /><br />"A layer with this name already exists...<br />...     if (myPageItems[i]  instanceof TextFrame && myPageItems[i].itemLayer.name = "listings")"<br /><br />So it's trying to create a new layer called listings.<br />Also - it seems to want to move the items to that layer?<br /><br />var myDoc = app.activeDocument;<br />app.findPreferences = null;<br />app.changePreferences = null; <br /><br />myObjectStyle = myDoc.objectStyles.item("defaultText");<br />myPageItems = myDoc.allPageItems;<br />for (var i = myPageItems.length - 1; i >=0; i--) {<br />     if (myPageItems[i]  instanceof TextFrame && myPageItems[i].itemLayer.name = "listings") {<br />          myPageItems[i].applyObjectStyle(myObjectStyle);<br />     }<br />}<br /><br />myDoc.search("<g>", false, false, undefined, undefined, {appliedParagraphStyle:"OFI Body copy_GREEN BULLET"});<br />myDoc.search("<k>", false, false, undefined, undefined, {appliedParagraphStyle:"OFI Body copy_BLACK BULLET"});<br />myDoc.search("<r>", false, false, undefined, undefined, {appliedParagraphStyle:"OFI Body copy_RED BULLET"});<br />myDoc.search("< b>", false, false, undefined, undefined, {appliedParagraphStyle:"OFI Body copy_BLUE BULLET"});

  • [win][js][cs4]find/change paragraph styles without losing local overrides

    Hi guys i need a little help here.
    I created a javascript which will find and replace doc file paragraph styles with indesign paragraph styles. everything works fine but the problem is that when it applies the paragraph styles it loses all local overrides. i tried:
    changetext(false);
    but its not working is there some kind of conditional parameter that i can put in the changetext() function so that it wont clear local overrides?
    Thanks.
    CharlesD

    Thanks Kasyan. You're always there to save my day. Thank you very much...
    I slightly modify the script to go through all my paragraph styles that need to be replaced coz there are hundreds of them. Im not sure though if this is the best or is there any faster way to do this:
    replace("T1", "Text", "T1");
    replace("T", "Text", "T");
    replace("1", "Heads", "1");
    replace("2", "Heads", "2");
    function replace(input, folder, output) {
        var foundItem;   
        var doc = app.activeDocument;
        app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;
        app.findGrepPreferences.findWhat = ".+";
        app.findGrepPreferences.appliedParagraphStyle = input;
        var foundItems = doc.findGrep();
        for (var i = 0; i < foundItems.length; i++) {
            foundItem = foundItems[i];
            foundItem.applyParagraphStyle(doc.paragraphStyleGroups.item(folder).paragraphStyles.item( output), false);
        app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;

  • What is the function to change paragraph styles?

    I'm trying to make a simple script that changes a raw data file that has preset Paragraph style already in the exported data from a HTML calender, and once its copied over into Indesign it changes the already existing paragraph style into a diffrent paragrph style?
    is this a simple script, I got no idea what the script function is to make the change of paragraphs.

    Would this work? or do I got the wrong function commands?
    var myInDesign = app
    var myDocument = app.activeDocument
    var myDocName = myDocument.name
    app.findParagraphStyle.caseSensitive = false;
    app.findParagraphStyle.wholeWord = false;
    app.findCharacterStyle.wholeWord = false;
    app.findCharacterStyle.caseSensitive = false;
    app.findParagraphStyle.findWhat = "SN.outabout.DAY-Gray";
    app.changeParagraphStyle.changeTo = "SN.Holiday-Day_of_the_week";
    app.documents.item(0).changeParagraphStyle();
    app.findParagraphStyle.findWhat = "SN.outabout.DATE";
    app.changeParagraphStyle.changeTo = "SN.Holiday-Month_and_Day";
    app.documents.item(0).changeParagraphStyle();
    app.findParagraphStyle.findWhat = "SN.listingsLT";
    app.changeParagraphStyle.changeTo = "SN.Holiday-Paragraph";
    app.documents.item(0).changeParagraphStyle();
    app.findCharacterStyle.findWhat = "SN.listingsBOLD";
    app.changeCharacterStyle.changeTo = "SN.Holiday-Title_Paragraph";
    app.documents.item(0).changeCharacterStyle();
    //myInCopy = CreateObject("InCopy.Application.CS3")  //Not sure if this would work, just crafting idea's.
    //var myDocument = myInCopy.ActiveDocument
    //var mySelection = myInCopy.Selection.Item(1)
    //var myStory = MySelection.ParentStory
    //var myText = myStory.Paragraphs.Item(1)
    //myStory.CheckOut
    //myText.ApplyParagraphStyle myDocument.ParagraphStyles.Item("zAPPROVED"), True
    //myStory.CheckIn
    Can I just do this with like a Nested If, then Statement?

  • Change paragraph style of empty row using GREP

    Hello again ... another GREP query if anyone can assist!
    How can I change a completely empty paragraph line (like those found between verses in a poem, for example) to a different paragraph style so I can control the space better using GREP?

    Fair point ... but if I demonstrate:
    Text line here
    Text line here
    Text line here
    Text line here
    Text line here
    Text line here
    The empty row (4) between the two blocks is in the same paragraph style as the rest of the text. Indeed if lines 3 or 5 were in different styles I could remove the empty row and create a space using before/after spacing. But it is all in the same style. I was wondering if there was a way using GREP to change the para style of an empty row ie 4.

  • How to change paragraph style

    I have a text frame selected and it contains a story having various pargraph styles applied.
    I want to get name of each paragraph style applied in it and replace each with some other styles.
    But when I am applying style only one style is applied to whole text frame .(i.e all existing styles are replaced with a single style).
    Please help me , if there is any way.
    Thanks

    It was not a criticism of your design choices. You have misread my comments, I am simply warning you from long experience. We have no idea of what you do or don't know, most people who come here have little and it is safer to assume they have none.
    Creating a Textbox, which is randomly sized and placed and contains no text, is not dissimilar to having a Textbox already in the document with Placeholder text in it that you click on and it is replaced by whatever you type. If your client is quite familiar with Pages they must be familiar with using Placeholders and with duplicating and resizing objects as required. It is just a way of getting around your problem.
    Obviously you have done something else, or you would not be getting the results you have. I keep my version of Pages 5.5.3 as installed for testing, I don't know what you have done that is different and can't tell without having the file.
    If you want me to look, email me via my blue name. If not, that's fine too.
    Peter

  • Changing Paragraph Style Export Tagging Options

    I'm having a heck of a time trying to get the "Split Document (EPUB only)" box checked for certain styles. I was hoping an experienced scripter may be able to help me solve what I'm sure is an easy fix.
    My code snippet is below:
    var doc = app.activeDocument;
    var par_styles = doc.paragraphStyles.everyItem().getElements();
    for (var i = 0; i < par_styles.length; i++) {
         par_styles[i].styleExportTagMap.splitDocument = true;
    In this example, I'd like to get the Split Document checkbox checked for every paragraph style in my document. However, apparently the paragraph style doesn't support the "styleExportTagMap" class, which is the only place I've found that the "splitDocument" property lives.
    I assume my ignorance arises from not knowing exactly what the styleExportTagMap(s) class does.
    Could anyone point me in the right direction?

    Seems like a hack, but it works.
    var
        doc = app.activeDocument,
        par_styles = doc.allParagraphStyles,
        i = 0;
    for ( i ; i < par_styles.length; i++ ) {
        par_styles [ i ].styleExportTagMaps.add ( "", "", "", "" ).splitDocument = true;
    Hope that helps.
    Marijan (tomaxxi)
    http://tomaxxi.com

  • Script to list paragraph styles

    Does anyone know of a script that will list all the settings for the paragraph styles in an InDesign file?

    See here: http://jsid.blogspot.com/2005/10/text-styles-reporter.html
    Peter

  • XML import is changing paragraph styles?!

    After importing my translated XML-File the "copy"- Paragraph style is overwritten by my "Headline"- Paragraph style. Any Ideas why this issue is occuring? I hope the screenshot is kinda helpful in any way (simplified version of my problem) - best regards!

    On the paragraph styles panel or table styles panel, delete the style and replace with another style.

  • 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

  • Script for changing objects presence based on amount range

    Hello,
    Is there a way to change an objects presence (either a field or a subhead) based on the entered amount range in a numeric field? 
    For example:
    -The numeric field amount entered is a range between 1 and 49,999, then "Signature Subhead 1" appears.
    -The numeric field amount entered is a range between 50,000 and 250,000, then "Signature Subhead 2" appears.
    Etc.
    Any advice for this script would be appreciated.
    Thanks!

    Hi Bruce,
    Your solution worked perfectly.  If I was to expand the ranges (let's say to three ranges), would I just have to add another "case this" logic section such as this?
    switch (true)  
    case this.rawValue >= 1 && this.rawValue <= 49999:  
      SignatureSubhead1.presence = "visible";  
      SignatureSubhead2.presence = "hidden";
      SignatureSubhead3.presence = "hidden"; 
      break;  
    case this.rawValue >= 50000 && this.rawValue <= 249999:  
      SignatureSubhead1.presence = "hidden";  
      SignatureSubhead2.presence = "visible";
      SignatureSubhead3.presence = "hidden";    
      break;
    case this.rawValue >= 250000 && this.rawValue <= 500000:    
      SignatureSubhead1.presence = "hidden";  
      SignatureSubhead2.presence = "hidden";
      SignatureSubhead3.presence = "visible";    
      break;  
    default:  
      SignatureSubhead1.presence = "hidden";  
      SignatureSubhead2.presence = "hidden";
      SignatureSubhead3.presence = "hidden";   
    Appreciated,
    Eric

Maybe you are looking for

  • How do i get auto fill to work in numbers

    hi i have a list of text in my spreadsheet colume that changes on each line. please tell me how to use auto fill thus allowing me not to write the same taxt over and over

  • Listener pre-requisite for create database using dbca

    Hello All: Oracle binaries successfully installed using dbca (Advanced Installation, Custom, Install DB software only) Now when i use dbca to create a database, i have noticed one of the screen prompts me to "Select the listeners for which you want t

  • My iphone 4s shuts down automatically

    My new iphone 4s shuts down by itself.  Sometimes it starts up again and other times it just stays off.  Should I just take it back to the Apple store while it is still under warranty?

  • What is the old tRFC scheduler for BW 3.x?

    Hello, Does anyone know the old trfc scheduler prior to Netweaver 7.0? Because as of 7.0 it is SMQS. What was the old one before for BW 3.x?? Regards, Jennah

  • There is no skype icon after i go onto application...

    i downloaded skype on my macbook pro. after i did it told me to move my cursor to the applications icon and double click on it. after i did, i was unsure on what to do. it doesnt show a skype icon to go on and login and start using it. it had nothing