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

Similar Messages

  • How to create a report  based on selected item from Select list?

    Hi,
    I have created a tables_LOV based on:
    select table_name d, table_name r from user_tab_cols
    where column_name like '%_type%'
    Then I created a page item ListOfTables,  Display as select list and pointing to tables_LOV.
    I run the page, and i can select the table i want from the drop down list.
    How to create a report  based on the selected item? (ex: select * from selected_table)
    many thanks in advance
    Salah

    Hi Salah,
    Allright, have a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report
    I think that simulates what you're trying to accomplish. I've set up the simplest method I could think of.
    The report is based on an apex collection. If you are not familiar with that, you should study the documentation: APEX_COLLECTION
    To recreate my example you should:
    1) create an (interactive) report on your collection
    SELECT *
       FROM APEX_collections
    WHERE collection_name = 'MY_COLLECTION'
    2) create a page_item select list for the tables you want to display (in my case this is called "P38_TABLES" )
    3) create a dynamic action that triggers on change of your select list page_item. The dynamic action must be a PL/SQL procedure perfoming the following code:
    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
    end;
    Make sure you add your page_item to the "Page Items to Submit" section.
    4) Add an extra true action that does a refresh of the report region.
    Here are two pictures describing the da:
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA1.png
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA2.png
    Good luck and regards,
    Vincent
    http://vincentdeelen.blogspot.com

  • 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

  • 'Clear Paragraph Style' and 'Clear Selection Style'

    In an old archived topic, someone wrote:
    quote:
    In DWMX, you could select text in the design view and in the
    "HTML Styles" window (which no longer exists in MX 2004) all you
    had to do was click "Clear Selection Style" and all HTML formatting
    (paragraph tags, font faces, colours, bold, italics etc) would be
    removed. This was marvellous for reformatting <font> tag
    based text with CSS. MX 2004 claims to be a CSS machine, but it
    seems to lack this very important feature which helps to re-inforce
    the use of CSS over font tags.
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=189&threadid=714513&arc tab=arc
    I absolutely agree, and none of the alternative methods
    people suggested in that thread matched this lost feature for speed
    and ease of use.
    I've not seen a replacement for these commands in Dreamweaver
    8 either (although I've often wished for one). Does anyone know of
    a hidden feature that exists in version 8 for removing all the HTML
    formatting in one fell swoop?

    I count 4 steps.
    1. Copy the entire line
    2. Paste into notepad
    3. Copy the entire line
    4. Paste into DW
    That does it nicely no matter how much presentational markup
    there is.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Kals" <[email protected]> wrote in message
    news:[email protected]...
    >
    quote:
    I think what the O/P is wanting is a quick and easy method to
    remove
    > all of
    > those presentational tags.
    >
    > Thanks Gary ? spot on! I'll use the term 'presentational
    markup' rather
    > than
    > 'HTML styles' from now on. (Excuse my ignorance, but
    what's an 'OP'?
    > Should I
    > like being called such a thing? :)
    >
    >
    quote:
    Murray: ? but you just cannot create predefined "HTML STYLES"
    any
    > longer.
    > It's no great loss....
    >
    > Agreed! Okay, we've established that no one's lamenting
    the loss of 'HTML
    > styles' in the sense of a style sheet that stores HTML
    presentational
    > markup.
    >
    >
    quote:
    And if "HTML STYLES" were not used in the first place, then
    even having
    > that feature available now wouldn't help OP, if your
    interpretation is
    > correct.
    >
    > Perhaps you are misinterpreting what those commands did.
    'Clear Paragraph
    > Style' was the equivalent of applying a predefined 'HTML
    style' with no
    > presentational markup ? making it as far as I know, the
    quickest, easiest
    > way
    > to strip all presentational markup out of your HTML
    (irrespective of
    > whether
    > the markup originated through the use of 'HTML styles').
    This could have
    > very
    > easily been replaced by a stand-alone command.
    >
    >
    quote:
    There are certainly quick and easy ways to remove many of
    them.
    > Okay then, here's the test. How many steps does it take
    you to clean up
    > the
    > following paragraph?
    >
    > <p align="center"><font size="+1" face="Times
    New Roman, Times, serif">The
    > quick
    brown fox
    jumps over the
    <font
    > color="#FF0000">lazy</font>
    dog</font></p>
    >
    > I count 10 steps if you select the entire paragraph and
    use nothing but
    > the
    > Properties panel and/or Text menu. Perhaps you can beat
    my attempt. If I
    > use
    > the 'Clean Up HTML' command, it takes me about 20
    seconds to check for and
    > type
    > in all the individual tags I want removed, then I still
    have to manually
    > fix
    > the alignment. Do you know of a quicker, easier way?
    >

  • 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

  • How do you automatically create paragraph styles from a document?

    Hi,
    (posted in general indesign as well - advised to post over here)
    I know I've seen this somewhere but can't for the life of me find it...
    How can I automatically create paragraph and character styles in an InDesign CC document? I'm sure I saw a script to do this and though I'll download that later...only i can't find it now.
    The scenario is that I have a document created by someone else which has lots of paragraph styles, but each one has over-rides on (so they're not really much use). I'm wanting something that will go through the document and create all the different styles that have been used.
    Any ideas?
    Thanks

    Hi
    I was given this tip to try: PerfectPrepText (http://indesignsecrets.com/perfectpreptext-a-smart-way-to-style-local-formatting.php) but couldn't get it to do what i was after unfortunately...however it did point me in the direction of something that does the trick:
    PowerStyles (DTP Tools - Power Styles for Adobe InDesign).
    Not sure if it's available for CC yet though.
    Thanks

  • 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

  • Create a structure based on Selection option field values?

    Hi Guys,
                 can anybody tell me is ther anyway to creat a strucitre after giving the values to selection screen .I have a req where fiscal period is entered based on this i have to create a structure suppose i he give 3 to 8 then i have to create a strucure with with some fields including period3 period4 like that until Period8 so is there anyway tocreate like that or not?
    Thanks,
    Gopi.

    You need an internal table not a structure.  Either count from from the low value to the high value adding a record to the table or select the entries from the Period master table for that selection range.
    Option 1
    REPORT  ZCOUNT.
    tables: t009b.
    select-options:
      s_period   for t009b-poper no-extension.
    data:
      gt_poper type table of poper,
      gs_poper type poper.
    start-of-selection.
      move s_period-low to gs_poper.
      while gs_poper le s_period-high.
         append gs_poper to gt_poper.
         add 1 to gs_poper.
      endwhile.
      loop at gt_poper into gs_poper.
        write:/  gs_poper.
      endloop.
    endloop.
    Option 2
    REPORT  ZCOUNT.
    tables: t009b.
    select-options:
      s_period   for t009b-poper.
    data:
      gt_poper type table of poper,
      gs_poper type poper.
    start-of-selection.
      select poper
        from t009b
        into table gt_poper
        where bdatj = '2007'
         and poper in s_period.
      loop at gt_poper into gs_poper.
        write:/  gs_poper.
      endloop.
    Not sure if t009b is the right table.
    Ta... JR

  • Create new JTable based on selection of previous table

    Hello All,
    I want to create a sort of selection table. I have a fairly large JTable that is row selectable. I want the user to be able to select some rows, and then create a smaller table just displaying the selected rows.
    The current problem I am having (I say current b/c I'm sure more will follow) results from users rearranging the columns.
    Example) When columns are arranged as: A B C. Then the user rearranges to B A C. The getColumns() method returns the columns in the right order (B A C), but the getData() method returns the data in the old arrangement. So the data now does not match up to the column names.
    Here are the two methods I mention above (note: This class extends from JTable, so the "super" calls call back to JTable):
    * Retrieves data from table.
    public Vector getData() {
      Vector data = ((DefaultTableModel)super.getModel()).getDataVector();
      return data;
    * Retrieves the column names
    public Vector getColumns() {
      Vector fieldNames = new Vector();
      Enumeration e = super.getTableHeader().getColumnModel().getColumns();
      while(e.hasMoreElements()) {
        String name = (String)((TableColumn)e.nextElement()).getHeaderValue();
        fieldNames.add(name);
      return fieldNames;
    }I hope I made my problem clear. Thanks for any/all suggestions!

    Ah! A vector of vectors is returned from the getData call.
    I assumed is was a vector as follows:
    A -> __data for A__
    B -> __data for B__
    C -> __data for C__
    But no, its:
    Row1 -> __A B C__
    Row2 -> __A B C__
    Row3 -> __A B C__
    etc...
    So after trying to code, I realized what I was doing. I was rearranging rows! Not columns! Why would JTable set up its rows in this fashion? Wouldn't it be more efficient to have the primary vector be the order of the columns? It seems that would make things much easier. Well, that's my little rant after finally realizing that my code wasn't broken, it was doing exactly what I told it to do!

  • Automatic place graphic below a paragraph style

    Is it possible in Indesign CS4 to place automatic a graphic below or above a paragraph style when you apply the paragraph style to a paragraph?
    In Framemaker it is possible, because they use "Reference pages" and in the the window to design a paragraph style, you can select which item on the reference page must automatic added below or above that style.
    I'm new for Indesign and I would like to know how to solve this problem. Any suggestions?

    jessevic wrote:
    That would be the most possible acceptable solution Peter!
    In Framemaker is this also the solution, but I thought there would be a better solution.
    In Frame, I created also a tabel with 2 columns and 1 row, in Indesign I will create a table with 2 columns and 2 rows.
    I hope it is possible to create a table-style where the illustration is already inserted.
    In ID, if you prefer, you can create a one-row two-column table, then split the left cell horizontally (Table > Split Cell Horizontally), paste the graphic in the bottom part of the split cell, and the text in the upper, then adjust sizes.
    If you want the developers to consider adding the ability to attach a container above/below a paragraph style to ID, post a formal request at:
    https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    DTP Tools' cross-reference plug-in for ID has a feature that you may want to investigate; the inserted cross-reference can define a cross-reference format that displays the reference source text according to the language property at the insertion point.
    EDIT: Contact for this plug-in is at www.dtptools.com.
    For example, if your cross-reference source text is "Note:", you can define the cross-reference format to display it as "Nota:" if the surrounding language at the insertion point is Italian, "Aviso:" if it's Spanish, "Achtung:" if it's German, etc. (DISCLAIMER: I'm only guessing at the word for "Note" in these other languages.) It's something like conditional text behavior, but instead of choosing show/hide, you set the language attribute for all content in the document to make it work. It may be simpler, hence more practical, to change the show/hide condition setting, which you can do across a book of files with the Synchronize feature, than to change all text styles to a particular language. Unlike FM, ID doesn't have a Global Update Options feature to change a property, like language, in all, (or selected) paragraph styles in a document in one action. Based-on paragraph and character styles might introduce more complexity than is necessary, though the operation is only needed once per language version.
    This may be TMI - probably conditional text is the simplest to implement, once it's set up.
    HTH
    Regards,
    Peter Gold
    KnowHow ProServices
    Message was edited by: [email protected]

  • Import ID tagged text file results in paragraph style overrides

    I have been working on a project that requires the import of a large amount of information from a database. I have defined all the paragraph styles in InDesign and have a program to apply the paragraph style to the database information creating the InDesign Tagged Text file. When I place it into my document the paragraph styles are recognized but there is an override. If I clear the override, the text looks fine. I have an example document that I have exported and imported some text to rule out the program, but even in this case, an override occurs. Text is there, the paragraph format is there, but font size (for example) is wrong. Where should I be looking to correct this issue?
    Harold

    I don't recognize any of those being wrong, per se. I have the file on another computer, so I mocked up yet another one. Sorry
    Again in this one I did ASCII export, no fancy characters. And this one demonstrates the problem, too. I have two kinds of paragraphs. A big one and a small one. I create those paragraph styles. I select the only two lines in the file. Export and then bring them in underneath themselves to compare.
    The paragraph styles for the newly Placed paragraphs are gone. The font color is the same. But the font size and font have not changed.
    I manually edited the IDTT and removed the <Japanese feature> tag. Placed it again. Font color is the same, but the size and font are wrong.
    In other words, my problem is that ID does not seem to apply the paragraph style to the text when it is imported. Aren't the font size and font defined in the Paragraph Style?
    My end goal is to define some paragraph styles and create the IDTT automatically from a database. My hope was that the paragraphs would be formated properly based on the predefined styles when the IDTT comes in. I cannot get it to do this even for a pared down example. Aren't other users doing this?
    Here is the IDTT on pastebin (with the <Japanese...> tag removed)
    http://pastebin.com/Vdc6NVDV
    And what it looks like after the intial Place with <Japanese...> tag in, edited line from Small to "Deleted Japanese feature...", removed tag from IDTT and then did another Place.

  • Quick paragraph style application transformation ... or reverse engineering a document the hard way?

    Hi everyone,
    I'm using Indesign 5.5 for Windows and have inherited a technical document with no styling applied (not even text threads or auto-pagination), but all the fonts are in the correct sizes and colours. So it looks ok in print, but trying to actually do anything with it is a nightmare.  For obvious reasons I WANT to apply paragraph styles to the document so I can generate a new auto-updating TOC, maintain and add to it, and all the other good stuff that means.
    My question is this - is my only choice to go through page by page and apply new styles (matching their current appearence) to every different heading and bullet point, or is there a nice easy way (or script) that i can use to whizz through the document for me, neatly applying a new style to each different font variety or element it finds (not altering their appearence) and leaving me with a nice list of styles I can rename (then take all the credit for? ha!) Basically take a document that's already been put together wrong, and make it right? I think this might've been imported into InDesign from something like Quark, hence the state it's in, but I don't have access to anything but this version. Any help you could offer would be great.  Oh, and if (as I suspect) my only option is indeed to apply all the styles manually one line at a time, then feel free to point and laugh, I doubtless deserve it.
    Thanks!
    Phil

    If you need to reproduce the existing page layouts, I'd suggest you read up more on what paragraph styles can do, before annihilating whatever layout and flow behaviors have been stuck on the content. For example, if level "X" headings always start at the top of a text frame, or top of a page, or even top of a right page, or top of a left page, a paragraph style property can do this. So you'd want to create and apply a paragraph that does this to those paragraphs before you thread text frames; the top of <whatever> frame paragraph property will keep the paragraphs in place.
    It is possible to create paragraph styles with properties that behave crazily when they do what you define for them. For example, you can define a paragraph style that sets the style of the paragraph that's created when you press Enter/Return. You can also use the smartness built into the Next Style property. If a paragraph style, say Head1 is defined to create a new paragraph when you press Enter/Return, it can also apply its next style property to the paragraph follows Head1 in the same text selection. So, if you select a paragraph that's supposed to become Head1 (which defines its next style as BodyAfterHead1) and also select the paragraph that follows it,  and then hold down Ctrl+Click on the Head1 style's name in the Paragraph Styles panel, Apply "Head1" then Next Style appears. If BodyAfterHead1 defines Body as its next style, and more than two consecutive paragraphs are selected, Head1 will be applied to the first paragraph, BodyAfterHead1 will be applied to the second paragraph, and Body will be applied to the third and following paragraphs.
    So, you'll be investing in setting up the Next Style property for paragraph styles, and selecting as many consecutive paragraphs as needed for applying a pattern of styles that agrees with your next style definitions. Each time you use this feature, you're collecting benefits from your investment.
    If you need to reproduce the look of the layout on some number of pages, you could export to PDF and use a script to efficiently place each page of a multi-page PDF on a "PDF layer" you create, that appears on every document page in the ID document, lock and move the layer below the active document layer, and use it as a placement underlay.
    Search Google for terms like "InDesign apply style and next style," "InDesign place multipage pdf script," "InDesign installing and using scripts," "InDesign paragraph style keep options," and "InDesign start paragraph options," without quotes, for informative links to anywhere on the Web, as well as on these Adobe forums. To limit the searches to Adobe forums only, include "forums.adobe" without quotes in the search query.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • 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

  • [CS4/5] [JS] Which paragraph style does the panel context menu action work on?

    Hi all,
    I am trying to write something similar as http://forums.adobe.com/message/2866720#2866720 for the paragraph style context menu. I also would like to find out which paragraph style has been selected when the context menu opens. In the thread there is a "dirty" solution for this, the Edit and Apply options of the context menu also mention the name of the paragraph style. This works as long as the paragraph style is unique.
    In my situation the paragraph style names are not always unique, the same name is used in different paragraph style groups. I thought of an even "dirtier" solution that might work for this. The basic idea behind this is to create a new text, asfaik Indesign will automatically apply the active paragraph style to this text and it is easy to grab this style. The code for this is below:
    var myDoc = app.activeDocument;
    var myTextFrame = myDoc.textFrames.add();
    myTextFrame.contents = "grab the paraStyle";
    var myParaStyle = myTextFrame.paragraphs[0].appliedParagraphStyle;
    myTextFrame.remove();
    In my situation this approach seems to work fine but I am wondering if there is something against creating a new textframe and removing it later? And will the new text always get the current selected paragraph style?
    Best Regards,
    Bill

    I finetuned the snippet above a bit further. In some cases the context menu will be activated (right mouseclick) from a style that is not currently selected. In thoses cases the example above doesn't give the correct information. In order to avoid this I am now applying the paragraph style of the current context menu to an intermediate textframe. The snippet below is placed inside the EventHandler of my custom context menu item.
    var myDoc = app.activeDocument;
    //store current selection
    var mySelection = myDoc.selection;
    //create intermediate textframe
    var myTextFrame = myDoc.textFrames.add();
    myTextFrame.contents = "grab the paraStyle";
    myTextFrame.select();
    //apply the para style of the context menu to the intermediate text
    var contextMenu = app.menus.item("Text Style List Context Menu"); //or "$ID/RtMenuStyleListItem"
    var applyMenuItem = contextMenu.menuItems.itemByID(8488).associatedMenuAction; //Apply "para style for context menu"
    applyMenuItem.invoke();
    //grab the para style of the context menu
    var myParaStyle = myTextFrame.paragraphs[0].appliedParagraphStyle;
    //restore original selection and remove intermediate textframe
    myDoc.selection = mySelection;
    myTextFrame.remove();
    Again this snippet seems to work fine. I realize this approach will only work for para styles in a Document object and not for default para styles defined in the Application (suggestions to solve this?). A further refinement could be to first check if a para style name is unique, if that is the case the solution of Jongware (see http://forums.adobe.com/message/2861568#2861568) can be used and an intermediate textframe is not required.  
    I know this is a dirty solution but are there any issues with this approach?

  • Paragraph Styles - Don't Work | Buggy?

    I'm on Windows 7 using PS CS6 (not extended) 64bit.
    I have watched several tutorial videos on Adobe and YouTube to see how to properly make and apply paragraph and chracter styles.
    I can select text and make a new paragraph style, but when I select another text layer and the text itself with the type tool and then click on that paragraph style I made in the menu, nothing. It does not apply.
    If I open the style and modify it, it does change the original text layer I made the style from, but only that layer.
    Am I doing something wrong or is this feature horribly buggy?
    Thanks

    Update...
    Some text layers I can select the text and simply click on the paragraph style and it applies, however, for most layers layers I select the text and a + appears next to the paragraph style. If I click the Clear Override icon it sometimes applys the paragraph style, sometimes it does not. Sometimes I have to select the text, choose the Basic Paragraph style and then the newly created paragraph style to get it to work.
    This has to be a bug. Is this only me? Any workarounds?

Maybe you are looking for

  • FCP 10.0.1 update now crashes every time I launch it!

    FCP update now crashes every time I launch it! Won't even open a project I started last week with version 10.0.0. I have a deadline at work so I've now got a big problem! I'm trying to give the new and supposedly improved FCPX a shot but this app is

  • PI Generates Proxy - CX_INVALID_TRANSFORMATION

    HI PI Experts... This error relates to PI7.1 We have generated a new proxy to invoke a Service Interface on PI7.1. So we have an ECC6 system calling PI7.1 via proxy. Our scenario is working...but we sporadically get a short dump with an execption: CX

  • Connecting HP G61 to Samsung TV

    Hi Wondered if any body could help, im trying to connect my HP laptop to my samsung tv. At first I was able to do this but then windows has made updates to my laptop and not only has the font changed I now cannot connect through HDMI cable to TV. It

  • Suggestion on a good external drive for imac

    I just got to the point of having no memory space. I am looking for the best approach to picking a solid, cost efficient external hard drive. Any suggestion on where to get or possible prices. TX-Nobya

  • SSO does not work with DNS change

    Hi all, I have an ITS service which works fine on intranet but do not work on internet.  But the same service when put on internet (ofcourse with a different DNS i.e. abc.mycompany.co.uk) and it breaks down.  When clicking on a webgui service or webr