Programming paragraph styles using the Javascript

I am exporting xml into a  indesign template and then creating a .jpeg programmaticatlly.  On conversion, is there anyway to format the xml so that paragraph styles are applied?

Let me be clear:
1.  We have some xml i.e.
<?xml version="1.0"?><Root Customer="BusinessCard" xmlns="" ID="0"><Story><Story><Field ID="1" Label="Fullname" Type="TextBox" Required="True" Prefix="" Suffix="" RegEx="">JohnDoe</Field><Field ID="2" Label="Job Title" Type="TextBox" Required="False" Prefix="" Suffix="" RegEx=""></Field><Field ID="3" Label="Telephone" Type="TextBox" Required="False" Prefix="T   " Suffix="&#xd;" RegEx="">T   0123456456&#xd;</Field><Field ID="5" Label="Mobile" Type="TextBox" Required="False" Prefix="M  " Suffix="&#xd;" RegEx="">M  0123456789&#xd;</Field><Field ID="6" Label="Email" Type="TextBox" Required="True" Prefix="" Suffix="" RegEx="">[email protected]</Field></Story><Field ID="7" Label="Address1" Type="TextBox" Required="False" Prefix="" Suffix="&#xd;" RegEx="">&#xd;</Field><Field ID="8" Label="Address2" Type="TextBox" Required="False" Prefix="" Suffix="&#xd;" RegEx="">&#xd;</Field><Field ID="9" Label="Address3" Type="TextBox" Required="False" Prefix="" Suffix="&#xd;" RegEx="">Middlesex T5 4566&#xd;</Field><Field ID="11" Label="Postcode" Type="TextBox" Required="False" Prefix="" Suffix="" RegEx="">Visit uytyu</Field></Story></Root>
2  We have an indesign template. template.indd
3. We import the xml into the template programatically and need to apply character styles to the prefixes on mobile, and telephone numbers.
4.  We need to apply the character styles in the .jsx script  that then exports the image as a jpeg and a pdf.

Similar Messages

  • Problem setting paragraph style using FindChangeByList

    am trying to apply a paragraph style using FindChangeByList. I can apply character styles but not paragraph styles.
    I need to apply the paragraph style "price" to every paragraph that begins with a "$"
    I have tried it everyway I can think of.
    any suggestions?

    Hi Carolyn,
    Try something like this (assuming JavaScript, and also assuming that the paragraph style is not in a paragraph style group):
    text<tab>{findWhat:"$"}<tab>{appliedParagraphStyle:app.documents.item(0).paragraphStyles.i tem("price")}<tab>{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
    (Where <tab> is a tab character.)
    Thanks,
    Ole

  • How can i give multiple paragraph styles on the same line

    i want to give different paragraph style in the same line in an indesign document. bt when i tried it, it is coming in two different line.
    actually i am doing a project in which Frame maker document is transformed into indesign document. in frame maker this is possiable, but in indesign i cannot give different paragraph style in the same line of the document.
    Is there any way to do this ????

    YaneshTyagi wrote:
    i want to give different paragraph style in the same line in an indesign document. bt when i tried it, it is coming in two different line.
    actually i am doing a project in which Frame maker document is transformed into indesign document. in frame maker this is possiable, but in indesign i cannot give different paragraph style in the same line of the document.
    Is there any way to do this ????
    Hi, Yanesh:
    Please understand, the FrameMaker feature known as a run-in paragraph, which is a paragraph with a "carriage return" but without a "line feed," HAS NO COUNTERPART in InDesign. InDesign also lacks the FrameMaker side heading feature, which is created by the combination of a reserved area in the text frame and the paragraph property to inhabit that area. FrameMaker separates paragraphs by using the larger of space below paragraph and space above paragraph, but InDesign separates paragraphs by adding the space below paragraph and the space above paragraph.
    There are several complicated manual methods of simulating these FrameMaker properties in InDesign.
    Here's a recent forum discussion of these exact issues: http://forums.adobe.com/message/3759635#3759635. The thread mentions DTP Tools' conversion tool, the MIF Filter commercial plug-in for InDesign, and discusses its shortcomings. I don't recall it mentioning in-tools.com plug-ins that can simulate side headings, like those in FrameMaker, but they don't convert FrameMaker to InDesign. 
    You can add your vote for InDesign's developers to include these FrameMaker features, and any others you'd like to see, here: wish.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • How do I stop ID from assigning a paragraph style to the TABLES?

    In-Design is adding "H1" paragraph style to EVERY table is inserted, so the table headers formatting is affected by that H1 style.
    I guess it chooses H1 because it's the FIRST style I created (and then modified the "basic paragraph" to modify the rest of default text).
    It's like it's adding "Style_ID=1"
    I tried placing the character in different places, to make sure it's not the style the cursor is in which is inherited, and no, no matter where I place the cursor, when I "insert table" the cursor is automatically placed into the first cell (header cell) and the paragraph "H1" is selected (and applied)
    Adding a table with NO headers does the same, so it's not me that confused style names and applied some to the wrong place.
    H1 is not used and table and cells styles are not based in it.
    I don't know whether it's a bug, but IT FEELS like a bug.
    How do I expect it to work?
    I expect that by creating a table, NO style be applied other than the table's. (Not even the basic one)

    You might have set the default paragraph style for the document (which you set by selecting a paragraph style with no text frame selected) to your H1 paragraph style.
    Make sure it's on "Basic paragraph" when you select the type tool..

  • [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?

  • How do I access *load paragraph styles* from the styles pallet menu?

    Adobe help informs me that I can bring styles from other documents into an existing document by doing this:
    "To copy paragraph styles from one publication to another choose Load Paragraph Styles from the Paragraph Styles panel menu."
    I do not see any menu in the paragraph style menu. I am in CS5. What am I missing?

    I'm sorry, I found it. I had to go back to my G4 and the CS version to see what to do. I did not recognize the small feature on the window yielding the menu.

  • What are the steps to make it seamless for a customer to use the install program and then use the installed program?

    I wrote an install program (.exe) that is downloaded from a website.  When run, it 1) leads a customer to browse to a directory, and 2) copies files (.exe, .dll, etc.) from a website to that directory.  When I run, the installed program works.
    What are the steps to make it seamless for a customer to use the install program and then use the installed program? 
    bhs67

    This site https://msdn.microsoft.com/en-us/library/vstudio/2kt85ked%28v=vs.110%29.aspx provides a basic description of the Visual Studio Windows Installer. 
    Near the bottom of the page is "You can unlock all the features of InstallShield by paying to upgrade to the full version of InstallShield."  Where do I find info that describes the differences between the "free" and the "full"
    versions?
    bhs67
    Hello,
    The default feature does support the task for your requirement, so there is no need to pay for the other features unless you want to use some feature which is not free.
    In addition, as this thread
    InstallShield LE not available with VS 2012 RTM? shared, even through there is a link to InstallShield LE in the New Project dialog under Deployment solutions, but it belongs to third-party that I would recommend you consider posting this issue
    at the following forum to get supports about InstallShield.
    http://community.flexerasoftware.com/forumdisplay.php?133-InstallShield
    Regards.
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • We tried the window.ResizeTo and window.MoveTo methods using the javascript. It doesn't seem to be working in the version 9.0.1. Please suggest any alternative .

    Hi,
    We tried the window.ResizeTo and window.MoveTo methods using the javascript. It doesn't seem to be working in the version 9.0.1. Please suggest any alternative .
    Thanks,
    Avinash

    This is no longer allowed for security reasons (bug 565541).<br>
    See https://support.mozilla.org/nl/questions/880032<br>
    https://developer.mozilla.org/en/DOM/window.moveTo<br>

  • InDesign cs5 keeps crashing whenever I try to alter the footnote formatting via Type Document Footnote Option or Paragraph Styles using Span Columns

    InDesign cs5 crashes whenever I try to alter the footnote formatting by going to Type > Document Footnote Option > and then I try to select a Paragraph style I've already set up. The Paragraph style I need to use includes Span Columns, which I think may be the issue. I think this because when I then I tried to create a new document and re-import the styles, it won't even let me add Span Columns feature to the Paragraph Style in question.
    I can send screen shots of everything (e.g. dialog boxes) if that would be helpful in understanding the issue I'm having.
    Any help would be greatly appreciated!!!!!!!!!!
    Thanks.

    It does require running a script to accomplish what you want. Here's the one usually recommended:
    http://www.kahrel.plus.com/indesign/footnotes_columns.html
    Here are instructions for installing scripts:
    How to Install a Script in InDesign That You Found in a Forum or ...

  • Multiple record data merge into paragraph styles-applies the wrong style

    Hi, I've been working on this project for sometime and everytime I manage to get one part of the workflow to work another seems to break. My agency publishes catalogs in multiple formats: large-print, audio, braille, and HTML. I've been trying to redesing our work process so that the catalogs will be laid out from merged data out of comma-separated file. The data merges have worked fairly well in Word, but InDesign is a challenge. I'm merging multiple records on a page, like a mailing label. The paragraphs need to be formatted and I'm trying to apply a paragraph style to them. After much work, I think I've finally got the data merge to work correctly, but the wrong paragraph styles are applied. I'm going to apply a new master page to the data once the data is merge that uses the paragraph styles for text variable running headers and I need to build a table of contents based on the paragraph styles so I need this to work. Attached are some screenshots.
    Master page set up for data merge with paragraph styles:
    Here is the merged document with the wrong paragraph styles applied:
    I have only a few weeks to get this process ironed out to keep to our rigorous production schedule. If anyone can help I would really appreciate it.
    thanks,
    Lina

    I don't remember this happening in past versions. But I mainly use XML. And a quicky test converting your file to XML worked fine (and besides, it ends up all in continuous text frames...).
    I don't do much GREP. But you can do this via a Find/Replace.
    First, in your main document, you can delete the tags--but do this on a second copy of your working file!
    Change your Content Placement options to not remove blank lines (these are in the Datamerge panel).
    Then after the merge, change the format of the two blank lines at the beginning of the records without the two lines of data:
    Note the Change Format style is changing those two paragraphs to Title.
    Then rerun the find to remove the two blank paragraphs.
    I suspect this can be done easier. I am sitting awaiting an appointment and cannot go much further than this for now, sorry.

  • Now impossible to insert the cursor by clicking in one paragraph. I am able to 'find' the cursor by going to another paragraph, then using the arrows to position the cursor in this rogue paragraph.

    I use Pages version 4.0.5.
    My software is all up to date, 10.6.8 version of OS.
    The particular document with the problem is 255 pages and currently at 125,000+ words. One area of a paragraph seems to be at fault and clicking within it has no effect. No cursor appears, no editing is possible and no other input is possible for that part of document.
    I can work round this by going to another paragraph, clicking there when the cursor appears, then using the arrows to get the cursor in to position in this 'rogue' paragraph.
    I am fairly new to Mac, only having bought this machine at the end of last year but have used it everyday since then. I did have problems with an image editing program supplied with a new Pentax camera but I have stopped using that program after taking the laptop to Apple tech in Sheffield UK who said the laptop was OK but the program was VERY slow and they could see when checking forums that this program was causing problems for other Mac users.
    That was about three months ago, so the laptop was deemed to have a clean bill of health then.
    I am curious and disappointed more than anything, as I can work around the problem at the moment.
    What might be going wrong, how can I correct it, if at all, and should I be worried that there might be a more significant problem developing?

    zxcwx wrote:
    (1) It is quite likely that I am losing what little cognitive ability I started with due to advancing years,
    (2) perhaps visual acuity as well so your red italic text made your point very well.
    (1) don't worry, I was born on 1943/12/31 23:55
    (2) It's why I change the size or the color from time to time.
    (3) I never use phrases when I search something. Just lowercase words 'linked' by the conjunction AND (uppercase)
    I'm remembering a thread about this behavior.
    https://discussions.apple.com/message/15102726
    Yvan KOENIG (VALLAURIS, France) samedi 9 juillet 2011 22:52:31 iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Program error when using the Eyedropper tool on Win8/Photoshop CC (14.2.1)

    After a year of using Photoshop CC (with many errors I still have to cope with) there is a new one. Whenever I use the color picker I get an error message, that the quest can not be done for a program error. I click close and I can use the new color but I can not see it in the tool bar preview. This really disturbs my flow while working a great deal (always clicking the error message away, never having a color preview). I am annoyed paying 25 € per month for so many error, just because Photoshop is considered a standard in the industry.

    First Part System Info:
    Adobe Photoshop Version: 14.2.1 (14.2.1 20140207.r.570 2014/02/07:23:00:00) x64
    Operating System: Windows 8 64-bit
    Version: 6.2
    System architecture: Intel CPU Family:6, Model:10, Stepping:9 with MMX, SSE Integer, SSE FP, SSE2, SSE3, SSE4.1, SSE4.2, HyperThreading
    Physical processor count: 2
    Logical processor count: 4
    Processor speed: 2494 MHz
    Built-in memory: 3798 MB
    Free memory: 1788 MB
    Memory available to Photoshop: 3114 MB
    Memory used by Photoshop: 60 %
    Image tile size: 128K
    Image cache levels: 4
    Font Preview: Medium
    TextComposer: Latin
    Display: 1
    Display Bounds: top=0, left=0, bottom=1080, right=1920
    OpenGL Drawing: Enabled.
    OpenGL Allow Old GPUs: Not Detected.
    OpenGL Drawing Mode: Basic
    OpenGL Allow Normal Mode: True.
    OpenGL Allow Advanced Mode: True.
    AIFCoreInitialized=1
    AIFOGLInitialized=1
    OGLContextCreated=1
    NumGPUs=1
    gpu[0].OGLVersion="3.0"
    gpu[0].MemoryMB=1962
    gpu[0].RectTextureSize=16384
    gpu[0].Renderer="Intel(R) HD Graphics 4000"
    gpu[0].RendererID=4416
    gpu[0].Vendor="Intel"
    gpu[0].VendorID=4318
    gpu[0].HasNPOTSupport=1
    gpu[0].DriverVersion="10.18.10.3316"
    gpu[0].Driver="igdumdim64.dll,igd10iumd64.dll,igd10iumd64.dll,igdumdim32,igd10iumd32,igd10 iumd32"
    gpu[0].DriverDate="20131001000000.000000-000"
    gpu[0].CompileProgramGLSL=1
    gpu[0].TestFrameBuffer=1
    gpu[0].OCLPresent=1
    gpu[0].OCLVersion="1.2 "
    gpu[0].CUDASupported=0
    gpu[0].OCLBandwidth=0
    gpu[0].glGetString[GL_SHADING_LANGUAGE_VERSION]="1.30 - Build 10.18.10.3316"
    gpu[0].glGetProgramivARB[GL_FRAGMENT_PROGRAM_ARB][GL_MAX_PROGRAM_INSTRUCTIONS_ARB]=[1447]
    gpu[0].glGetIntegerv[GL_MAX_TEXTURE_UNITS]=[8]
    gpu[0].glGetIntegerv[GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS]=[96]
    gpu[0].glGetIntegerv[GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS]=[16]
    gpu[0].glGetIntegerv[GL_MAX_TEXTURE_IMAGE_UNITS]=[16]
    gpu[0].glGetIntegerv[GL_MAX_DRAW_BUFFERS]=[8]
    gpu[0].glGetIntegerv[GL_MAX_VERTEX_UNIFORM_COMPONENTS]=[4096]
    gpu[0].glGetIntegerv[GL_MAX_FRAGMENT_UNIFORM_COMPONENTS]=[4096]
    gpu[0].glGetIntegerv[GL_MAX_VARYING_FLOATS]=[64]
    gpu[0].glGetIntegerv[GL_MAX_VERTEX_ATTRIBS]=[16]
    gpu[0].extension[AIF::OGL::GL_ARB_VERTEX_PROGRAM]=1
    gpu[0].extension[AIF::OGL::GL_ARB_FRAGMENT_PROGRAM]=1
    gpu[0].extension[AIF::OGL::GL_ARB_VERTEX_SHADER]=1
    gpu[0].extension[AIF::OGL::GL_ARB_FRAGMENT_SHADER]=1
    gpu[0].extension[AIF::OGL::GL_EXT_FRAMEBUFFER_OBJECT]=1
    gpu[0].extension[AIF::OGL::GL_ARB_TEXTURE_RECTANGLE]=1
    gpu[0].extension[AIF::OGL::GL_ARB_TEXTURE_FLOAT]=1
    gpu[0].extension[AIF::OGL::GL_ARB_OCCLUSION_QUERY]=1
    gpu[0].extension[AIF::OGL::GL_ARB_VERTEX_BUFFER_OBJECT]=1

  • Using the JavaScript Debugger with Adobe Reader X (10.1.0) ?

    Hello all,
    Quite new to JavaScript in Acrobat I am trying to write a 4 page Form with CenoPDF and check/debug it with Adobe Reader X (10.1.0) on a Windows 7 (32bit, usually no Admin rights) PC. I realise Acrobat Professional would be a more appropriate tool, but for the moment I hope to get away with Reader.
    Following this instruction I managed to get the Javascript Debugger running with Reader X, but there is a serious issue:
    The Debugger window often crashes - and with it the whole Reader - after clicking around on a few controls (triangles in the Scripts window or others). First the font changes, then letters disappear, controls disappear and soon after the whole user interface freezes (see the two screenshots below).
    Questions:
    Do others also have problems with crashing Debuggers?
    Is there a known solution or work around to this problem?
    Many thanks for your help or some info, BobDuke

    I am having the same problem.  Win 7 or Win XP doesn't matter the problems seems to be with Adobe 10.1.0.  Works ok with Word, but not adobe reader.  Doesn't un-collate if the box is checked.  Tried to unchecked then recheck.  Use to work but now it doesn't.

  • Is it possible to set up a Paragraph Style leaving the Font Style field blank?

    We often have to import text into InDesign from Word docs. We place the docs (Command-D, rather than copying and pasting) in order to preserve italics, bold text, etc. As it is now, we have to select all the text and set each element separately - leaving the Font Style field blank - in the Character Palette.
    It would save a lot of time, if we could set up a Paragraph Style without specifying the Font Style, (leaving it blank), which overrides the formatting we are trying to preserve. Is this possible?

    The answer is "kind of". You can create the Paragraph Style you want to apply and select the paragraphs you want to apply it to - then right-click on the Paragraph Style and choose 'Apply "Body". Clear Character Styles.'
    It is possible to do this as a Character Style if you click outside of a text area and create a new style. I do it all of the time as I import lots of Word documents to write to ePub (you have to define all of the styles to ensure the document looks right). Since the documents come in with small caps, bold, italics, different font sizes but the same font throughout.
    So I have a style based on None with blank Font Size and Font Style which I apply to the whole document. If there is anything in these boxes you can just erase it by backspacing over the text.

  • Exiting programs that have use the fullscreen exclusive mode

    I have lots of problems, this is one of them:
    When making a program that uses fullscreen mode, the program does not exit by itself when it comes to the end of the program. In fact the only way I can get it to exit is through System.exit(0);
    And I don't want to use that for numerous reasons.
    try
    gd.setFullScreenWindow(jw);
    gd.setDisplayMode(dm[theDisplayMode]);
    finally
    gd.setDisplayMode(oldDisplayMode);
    gd.setFullScreenWindow(null);
    end of program......
              }

    I have lots of problems, this is one of them:
    When making a program that uses fullscreen mode, the program does not exit by itself when it comes to the end of the program. In fact the only way I can get it to exit is through System.exit(0);
    And I don't want to use that for numerous reasons.
    try
    gd.setFullScreenWindow(jw);
    gd.setDisplayMode(dm[theDisplayMode]);
    finally
    gd.setDisplayMode(oldDisplayMode);
    gd.setFullScreenWindow(null);
    end of program......
              }

Maybe you are looking for

  • HT4959 can you update old iphones?

    I've never done a software update on my iphone 3... Now I'm trying to figure out if it'll work, when I select update, it gives me a network connection error?

  • Cgicmd.dat and do what with it???

    What do i need to put into the CGI and what do i need to add to my html string to hide the uname and pword.

  • Gigabit router questions

    If I have a router with a gigabit switch connected to my cable modem, and I run a Cat5e cable from that router to a switch in another room that is not a gigabit switch and then connect computers to that switch, do those computers lose the advantage o

  • Weblogic 5.10 and Macromedia Flash

    I am currently using Weblogic Server 5.10 on an Windows 2000 Operating System and my customer would like to use Macromedia Flash presentations streamed through their site to the client browsers. I was wondering if there was any configuration involved

  • Outlook Express or Firefox hangs when opening a link from OE

    When opening a link in OE6 emails, Firefox 6 takes eons to finally come up if it does not hang OE in the end. It makes no difference if Firefox is already open or if it needs to launch. Any idea what is going on. This is a new problem in the last few