Scripting: Bounding Box Paragraph Style

I just got off of a chat with Om of Adobe Tech Support.  He informs me what I am trying to do is possible with scripting, but I am not skilled at this at all, so I was hoping the community here might be able to help me.  What I am trying to do is this...
I am laying out a document that has certain paragraphs that need to be surrounded by a box with a 1p0 black line. When the paragraph in question is split between two columns the top half of the box needs to surround the text in the first column, and the bottom half of the box needs to surround the text at the top of the next column. In other words the box needs to be split as well as the paragraph. When in the middle of a column the box is intact. I had been drawing the box by hand, but when the text is reflowed for whatever reason all of the boxes need to be moved and many of the 3 lines of half boxes need to be be redrawn. I am looking for a way to accomplish the same thing programatically by designing a style to handle not only the text, but the bounding box as well.
Below is a screenshot of a finished PDF that illustrates both a bounding box in the middle of a column, and one split between columns.  Any and all help would be greatly appreciated!
A sample script (I may be able to alter if necessary), or a finished script would be great!  I am also quite a n00b with InDesign, and would need a quick tutorial on how to use the script.
Thanks!
Alex D. Karaczun

Ariel, rest assured it wasn't the price for a custom script I was objecting to. I'm sure you have more experience with that than me (considering my one and only commercial script took 6 months for creating a working concept only -- $450 would not be enough to cover those costs!). A fully custom job, plug-in or script, can be very expensive, and maintaining and updating it can be time consuming as well.
Karaczun: there are some major differences between scripts and plug-ins I need to mention. The same script can run, by and large, on both Mac and PC versions of InDesign, and with some luck on different versions of InDesign as well. Also, it has no influence at all on the document itself -- this can still be opened and edited without having the script installed.
A plug-in, on the other hand, works only on (a) a certain version of InDesign (you need different versions of the plug-in for different versions of ID), and (b) a certain platform (you need a Mac OS version or a Windows version). Also, depending on how the plug-in operates, it may be impossible to edit or even open the document on computers without the plug-in.

Similar Messages

  • 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

  • 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

  • [JS IDCS5] Space before paragraph if previous paragraph style is....

    Hi,
    I've got a heading paragraph style that has got some space before defined. But when a previous paragraph has got some space after defined, I've got two times spaces between them. Is it possible to script when two certain paragraph styles follow up, that one of these styles is changing to a style without spacing?
    Regards, Sjoerd

    This ought to get you started -- but Sjoerd, there is no way you can 'attach' this kind of script to a paragraph style. That's why you have to run the script *every time* you changed a style somewhere ...
    app.findTextPreferences = null;
    app.findTextPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyles.item("Heading 1");
    sourcelist = app.activeDocument.findText();
    targetlist = [];
    for (l=0; l<sourcelist.length; l++)
    next = sourcelist[l].paragraphs.nextItem(sourcelist[l].paragraphs[0]);
    if (next != null && next.appliedParagraphStyle.name == "Heading 2")
      targetlist.push(sourcelist[l]);
    alert (sourcelist.length+" -> "+targetlist.length);

  • I want to open "Paragraph Style Options" dialogue using Script(jsx)

    Hi,
    I have created a paragraph style using JSX.
    var myDocument = app.activeDocument;
    var myParagraphStyle = myDocument.paragraphStyles.item("myParagraphStyle");
    Now I want to edit my paragraph style using the "Paragraph Style Options" window. How can I open the window for myParagraphStyle using JSX?
    Is there any way to do it? I don't want to manually double click the name in the list to open it.

    @kapoor_aman27 – with a little trick we could select a distinct paragraph style in the Paragraphs Style panel.
    Add a new text frame to the document, add some contents, one character is sufficient. Format its contents with your paragraph style. Set the Paragraph Styles panel to visible. Select the text in the text frame with something like that: app.select(myTextFrame.texts[0]). Remove the text frame; the paragraph style stays selected in the panel.
    The next step would be to invoke the "Paragraph Style Options" panel. The id for the appropriate scriptMenuAction is 8481.
    try{
    app.scriptMenuActions.itemByID(8481).invoke();
    }catch(e){$.writeln(e.message)};
    But unfortunately this would throw an error. Something like this:
    (Error message in German:)
    "Mit der angeforderten Aktion wurde ein asynchrones, modales Dialogfeld geöffnet,
    für das eine Vorschau erstellt werden kann.
    Dies ist nicht mit der Skriptarchitektur kompatibel, daher wurde das Dialogfeld
    mit der Standardschaltfläche automatisch verworfen."
    (Roughly translated to English:)
    "An asynchronous, modal dialog box was opened by this action.
    A preview can be created with that dialog box.
    This is not compatible with the scripting architecture, therefore the dialog box
    with the standard button was automatically rejected."
    So I see no chance to do what you want.
    (Tested with inDesign CS5.5 on Mac OSX 10.6.8)
    Don't know, if that behavior has changed for more recent versions of inDesign…
    Uwe

  • Need  Bookmark creation script for Paragraph style. Anybody can help me pl?

    Need  Bookmark creation script for Paragraph style. Anybody can help me pl?

    Hi hasvi,
    I wrote a similar script which creates a bookmark on each page in the "main" text frame at the begining of the frame (the 1st insertion point). Here I attached the script and a couple of sample documents: before and after. It's more complex than what you want but you can use it as a starting point. In fact, you have to find a certain paragraph style, loop through every found item and insert a bookmark, say, at the beginning of the found text.
    The dialog box
    Bookmarks added
    Regards,
    Kas

  • (new to scripting) Only allow certain paragraph styles to break to next column/page

    Hi all,
    As stated, I'm very new to scripting. I've done a few small scripts to automate Photoshop tasks and such. I'm in the process of trying to learn Javascript as much as possible, with the hope of bringing about more efficiency for our small production department. It's a daunting task, but I'm trying my darnedest.
    One of the number one goals I have is the find a way to automate pagination of weekly transaction records. These records run between 32 to 48 pages normally, with each page having 5 columns. Creation of these pages is very systematic, so it would seem that this process should be able to be automated, but there are some challenges I'm having a hard time thinking about how to attack.
    One of the key tasks needing to be figured out is getting the records to go in with headings and subheadings always starting at the top of a page/column. Just about all the copy comes in with predetermined paragraph styles, so a script should easily be able to search for instances of each style. What needs to eb accomplished is only allowing the flow of copy to break on certain styles and not others ... (counties, towns, etc.)
    For example: if you have the following  ...
    Countyland <styled "county">
    Utopiatown <styled "town">
    46 Appletree Lane ...... $500,000  <styled "listing">
    Sold by: Some Guy   <styled "listing">
    Bought by: Other Guy  <styled "listing">
    Mortgage: This Bank  <styled "listing">
    Date: 12/14/11  <styled "listing">
    Dystopia Village <styled "town">
    47 Orangeplant Road ...... $400,000  <styled "listing">
    Sold by: Some Guy   <styled "listing">
    Bought by: Other Guy  <styled "listing">
    Mortgage: This Bank  <styled "listing">
    Date: 12/14/11  <styled "listing">
    If the two records above were to fall near the end of a column, the break to the next column should NOT occur anywhere except:
    - Before the county (causing the county to start at the top of the next column
    - Before the second town (Dystopia Village, forcing that town to the top of the next column)
    - After both (forcing whatever town/county is next to goto the top of the next column)
    So basically, I need to find a way PREVENT column breaks where they should not occur. Inserting column breaks is one thing (I know how to do that). Prevention is the issue though that confounds me.
    Does anyone have any thoughts of how to achieve such a thing? I know there are "non-breaking space" characters ... is there, or could there be, some kind of a "non-breaking return" character? Or would it be more feasible to test for the paragraph style at the bottoms of columns and insert column breaks in once it finds an appropriate match?
    Am I going about this all wrong?
    Again, any help or suggestions are more than welcome.
    Thanks much.
    ~Nate
    FYI .. using InDesign cs5.5

    I am now wondering about a possible solution. It would be one hell of a challenge for me to figure out how to code it, but I at least need to figure out the theory first, then I'll try to figure out how to code it.
    Again, the issue at hand is preventing column breaks for the "listing" style in the following example. Please note, the number of "listing" lines varies. If the following two entries (in a long list of similar entries) were to be near the end of a column, I'm trying to cause the flow of text to break only before a county style, or a town style (if it's not the first town in the county).  Basically, no breaks in the middle of listings.
    Countyland <styled "county">
    Utopiatown <styled "town">
    46 Appletree Lane ...... $500,000  <styled "listing">
    Sold by: Some Guy   <styled "listing">
    Bought by: Other Guy  <styled "listing">
    Mortgage: This Bank  <styled "listing">
    Date: 12/14/11  <styled "listing">
    Dystopia Village <styled "town">
    47 Orangeplant Road ...... $400,000  <styled "listing">
    Sold by: Some Guy   <styled "listing">
    Bought by: Other Guy  <styled "listing">
    Mortgage: This Bank  <styled "listing">
    Date: 12/14/11  <styled "listing">
    Naomi previously suggested messing with the "keep options" in the styles. This will solve the issue of preventing breaks before listing details start. But it won't help in keeping listing details from breaking, since the number of lines can vary.
    I'm now thinking ... might it be possible to have a script search all copy, looking for the last line of listings, and then apply a second listing style with a different keep option setting? The "normal listing" style would "keep next 1 line". The "last listing" style would not, therefore, allowing a break.
    Here's a map of what I'm thinking: (bear with me on the terrible syntax, this is just for illustrative purposes)
    listingNormal has keep with next 1 line applied
    listingBreak does not keep with next line
    if currentLineStyle == listingNormal
    AND
    style of next line != listingNormal {
    currentLineStyle = listingBreak
    Does this make sense? If so, does this sound feasible?
    Thanks any and all.
    ~Nate

  • InDesign CC is bringing in style sheets from Word and other places that I copy type from, like email, Acrobat. In InDesign CS4, whenever I brought in text from outside it assumed the paragraph style applied to the waiting text box. The loss of this functi

    I used to be able to get text from a Word doc (copy it), and then go into my CS4 InDesign file and paste it into a waiting box that had a paragraph style assigned to it and boom, it would take on the assigned paragraph style of that text box. Now it brings in the style from wherever the text came from. If the font looks similar to what was there it can be too hard to tell that it's different. When you are working on a book with 200 pages and copying text from Word docs and dropping it in here and there in InDesign, it causes alot of extra work and problems.
    In fact I have lost alot of security functions I used to have in CS4 in CC2014 in InDesign, Photoshop, Illustrator and Acrobat and it is making me want to go back to CS4 in a hurry.

    I actually FINALLY found the answer!!!! In the preferences area you choose Clipboard Handling and then you choose "Text Only" under When Pasting Text and Tables from Other Applications (see photo).

  • [JS, CS3] a script to change language in all paragraph styles

    Hi,
    I made a script to change the language in all paragraph styles to "French", but when I run it I get the error: "Invalid request on root style". Could you please tell me what am I missing?
    myDoc = app.activeDocument;
    myStyles = myDoc.paragraphStyles;
    for (i = 0; i < myStyles.length; i++)
    myStyle = myStyles[i];
    myStyle.appliedLanguage = "French";

    Thanks a lot!
    The problem is solved
    Ola

  • Script to duplicate Basic Paragraph style, then change character point size

    I'm looking to create a script that will create a cascade of paragraph styles based on the [Basic Paragraph] style settings. My goal is for each new paragraph style's character point size to be a percentage of the original [Basic Paragraph]'s. So if [Basic Paragraph] is 100% (character point size 10pt), the script would create a paragraph style named '120%' that has a character point size of 12pt. Then 133%, 140%, so on and on. I modified a script found on this forum to generate those new styles, but I don't know how to create them to be basedOn the [Basic Paragraph]. Any help would be very much appreciated, thanks in advance.
    current script:
    var doc = app.activeDocument,  
        pstyle = ["100%", "120%", "133%" ];  
    for(var i =0;i<pstyle.length;i++)  
            if(pstyle[i] == "100%") 
                doc.paragraphStyles.add({name:pstyle[i], appliedFont:"Stag", pointSize:10});              
            else if(pstyle[i] == "120%") 
                doc.paragraphStyles.add({name:pstyle[i], appliedFont:"Stag", pointSize:10*1.2})              
            else if(pstyle[i] == "133%") 
                doc.paragraphStyles.add({name:pstyle[i], appliedFont:"Stag", pointSize:10*1.33333})              

    Try this,
    var doc = app.activeDocument, 
        pstyle = ["100%", "120%", "133%" ]; 
    for(var i =0;i<pstyle.length;i++) 
            if(pstyle[i] == "100%")
                doc.paragraphStyles.add({name:pstyle[i], basedOn: doc.paragraphStyles[1], appliedFont:"Minion Pro", pointSize:10});             
            else if(pstyle[i] == "120%")
                doc.paragraphStyles.add({name:pstyle[i], basedOn: doc.paragraphStyles[1], appliedFont:"Minion Pro", pointSize:10*12})             
            else if(pstyle[i] == "133%")
                doc.paragraphStyles.add({name:pstyle[i], basedOn: doc.paragraphStyles[1], appliedFont:"Minion Pro", pointSize:10*1.33333})             
    Vandy

  • Script to change language to all Paragraph Styles?

    Is there a script out there that will change the language of all styles in a document? I frequently need to take US English files with multiple folders of styles and convert them for Canada English and French. Find/replace language does well enough for one-off use but I would like to clean up file as I go for future use without going through each style one and a time.
    -Thanks!

    If you are using OSX this AppleScript will change all the style definitions and text for the active document to French. Just edit the first line for the desired language so Canadian English would be:  set lang to "English: Canadian"
    set lang to "French"
    tell application "Adobe InDesign CS6"
        set pstyles to all paragraph styles of active document
        repeat with i from 1 to number of items in pstyles
            try
                set applied language of item i of pstyles to lang
            end try
        end repeat
        set cstyles to all character styles of active document
        repeat with i from 1 to number of items in cstyles
            try
                set applied language of item i of cstyles to lang
            end try
        end repeat
        try
            set applied language of every paragraph of every story of active document to lang
        end try
    end tell

  • Grep script that looks for paragraph style A followed by paragraph style B

    Hello,
    I am fairly new to scripting in Indesign and I have run across something I want to script that I don't know how to do. Two of the paragraph styles that are in our files are Normal and Song. I need to add an extra paragraph return between all instances of Normal followed by a Song. I tried to search the forums to see if this was already on here somewhere and if it is I didn't come across it. I would like to set it up as a grep script but if anyone has an alternative way to do this I would like to know also.
    Thanks in advance

    Hi,
    So you could use a script.
    I assume a text frame with proper story is selected and whole story is in one frame or linked frames.
    myStory = app.selection[0].parentStory;
    if (myStory.constructor.name !== "Story")
         alert ("Select a destination text frame, pls\rand try again");
         exit();
    myNormal = app.activeDocument.paragraphStyles.item("Normal");
    mySong = app.activeDocument.paragraphStyles.item("Song");
    app.findTextPreferences = null;
    app.findTextPreferences.appliedParagraphStyle = mySong;
    mFound = myStory.findText();
    len = mFound.length - 1;
    if (len >= 0)
         while (len--)
         currPara = mFound[len].paragraphs[0];
              if (myStory.paragraphs.previousItem(currPara).appliedParagraphStyle == myNormal)
              currPara.insertionPoints[0].contents = "\r";
    rgds

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

  • [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);

  • Can automatic master application be scripted by paragraph style?

    Help! I've been trying to figure out how to do this for a few days now. I could have sworn I've seen this done somewhere, but I can't find any references now. Someone suggested that it might be scriptable, so...
    I'd like to conditionally select a specific master page template based on a paragraph style.
    For example, the first paragraph style on every chapter in my book is "Title (Chapter)." When that paragraph style shows up, I'd like InDesign to automatically apply the appropriate master page template to that page, but default back to the standard master for all following pages.
    Anyhow know how to do this?

    Hi
    There is a solution from freelance book design but is not gree. A more basic script can be found by google searching for ApplyMasterpageToStyleCS5.
    I hope it helps...

Maybe you are looking for

  • Memory profiler disabled in JDeveloper 10.1.3.3.0.4157?

    Hi, I'm using JDeveloper 10.1.3.3.0.4157, and it seems that the memory profile is disabled in this version. Or isn't it? How do I enable it? Thanks in advance!

  • ORA-12154 Oracle Client Error with VirtualBox

    This is rather lengthy and I am not sure this is the right forum for this question but it does involve the Oracle Client. My development environment consists of a single workstation that is not connected to a network. The OS for the database is Linux

  • Applescript icon not bouncing

    I've recently purchased an iMac with OS10.4. The scripts from my previous machine using OS10.3.9 are working, but the applescript icon does not bounce when there is a problem running the script. I use the bounce to let me know when there is a problem

  • Dutch Denim update (country variant) gives 8018830...

    The Denim update (country variant) finally arrived for the 630 in the Netherlands, a couple of days ago. But I can't seem to get this update installed as it shows a 8018830f error when preparing the installation, after a succesful download. Now I kno

  • Post journal of Balance carryforward

    Hello Expert,    Normally In SAP R/3, when we run balance carryforward of GL account (Tcode:F.16), system will carry forward balance in next year and dont post any journal in FI.   One of our client of china wants to post journal of Balance carry for