Map by name, Tags to Styles

In JavaScript, I can map Styles to Tags using autoTag but how do I map Tags to Styles by name?
Thank you,
Richard

#target indesign
#include "/Applications/Adobe InDesign CS3/Scripts/Xml Rules/glue code.jsx"
var myDocument = app.activeDocument;
var myRuleSet = new Array (new ProcessAll);
with(myDocument){                   
   var elements = xmlElements;
   __processRuleSet(elements.item(0), myRuleSet);
myDocument.mapXMLTagsToStyles();
function ProcessAll(){
   this.name = "ProcessAll";
   this.xpath = "//*"; 
   this.apply = function(myElement, myRuleProcessor){
      with(myElement){
         $.writeln(markupTag.name);
         var myParagraphStyle = myDocument.paragraphStyles.itemByName(markupTag.name);
         if (myParagraphStyle != null){
            myDocument.xmlImportMaps.add(markupTag.name, markupTag.name);
   return true;

Similar Messages

  • Problem Mapping Tags to Styles in CS2

    Hello, I am running CS2 (V4.0.5) on XP SP2. I have XML-tagged text that I am mapping to styles/map by name. While the paragraph styles apply correctly, character style sheets that shouldn't apply are being applied as well. I have replicated this multiple times.

    Hi,
    Can you provide some text examples from your xml file. This because to identify the concern in the xml coding.
    Regards
    Thiyagu

  • Map tags to styles (CS6, Applescript)

    I want to map a series of tags to styles in InDesign, but this seems not to work.
    The inverse, mapping styles to tags, works!
    Any idea? Thanks for your help!
    tell application "Adobe InDesign CS6"
              tell active document
      make XML export map with properties {markup tag:"Header", mapped style:"Header"}
      map XML tags to styles
              end tell
    end tell

    Hello, try
    tell application "Adobe InDesign CS6"
        set myDocument to active document
        tell myDocument
            set tList to name of every XML tag
            set tNumItems to count of tList
            -- XML tag to style mapping by name.
            repeat with j from 1 to tNumItems
                set tStyle to item j of tList
                make XML import map with properties {markup tag:tStyle, mapped style:tStyle}
            end repeat
            --Map tags to styles.
            map XML tags to styles
            --Map styles to XML tags by name
            repeat with j from 1 to tNumItems
                set tStyle to item j of tList
                make XML export map with properties {markup tag:tStyle, mapped style:tStyle}
            end repeat
            --Map styles to tags.
            map styles to XML tags
        end tell
        --Export xml para desktop para pasta a designar
        tell active document
            export to "xxxxxxxxx:aaaaaaaaa.xml" format "XML"
        end tell
    end tell

  • Js for Structure; XML; Map Tags to Styles...

    Hi all
    I am trying this forum entry again under a different heading. I may have confused readers.
    I have a ID file that contains XML content and lots of Character and Paragraph Styles.
    There is a map that connects Tags <-> Styles.
    This file is working fine. This file is now my "Template File"
    I have written a script that imports XML content of the same kind into a new file.
    The script also imports or loads all the Character and Paragraph Styles from the "Template File" into the "New File".
    Now I would like to import the maping between Tags <-> Styles into my "New File".
    Manually this is an easy process in ID, in the Structure pane, top right corner, is a pulldown, one of the commands is called "Map Tags to Styles..."
    I load the map and my "New File" looks perfect.
    I would now like to include this function into my script.
    So far I could not find any code samples for this.
    Can anybody help?
    Thanks Romano

    Thank you Fred
    No this imports the Tags only...
    what I am looking for is this:
    My script needs to "call this menu, press the Load... button, choose a file, import from that file"
    It would be some simple thing like loading the colour swatches from another file...
        app.activeDocument.loadSwatches(myStyleFile);  
    but would say something like     app.activeDocument."loadTagsStylesMap"(myStyleFile);  
    Romano

  • Map tags to style problem.

    Hello!
    I have a problem with indesign that i cannot understand. On the picture below, you can see my structure. PARAGRAPH is the tag of the text frame. Inside the text frame i have tagged the text. The things that should be paragraph style 1 (bröd) is tagged "PARAGRAPH1". The things that should be  paragraph style 2 (bröd_start) is tagged "PARAGRAPH2".
    I use map tags to style to map the different tags to a specific style. It looks like this:
    When I run the cursor over the text I can see the tags changing to the correct one in the tags panel. But the paragraph style is always "Bröd". It seems as if the tags to style is not applied!
    The reason that I want to to this is so I can manage first lines better. I map the first word of a "new" line to "Bröd_Start" so that the first line is aligned flush left. Like this:
    Anyone has any ideas why this is not working like it should?!
    Tank you!
    Regards,
    Lukas

    Hi,
    Thanks for sharing the document. I tried with your file and scrolling is working fine. I could choose and select the styles also.
    Did the bug happen after importing XML or before as well?
    Do you have other documents open while you are working on this document?
    Did you try cleaning your preferences and cache? If not, you can give this a try and let me know if the problem still remains.
    Regards,
    Pooja

  • Map styles to tags v. Map tags to styles

    Hi everyone,
    Indesign CS4 has an option in the tags panel to:
    1) Map styles to tags
    and
    2) Map tags to styles
    Does anyone know what the difference between these two options are?
    Appreciate any help.

    Tags and Styles serve two separate functions.
    A Tag defines data that belongs to a specific element and is enclosed with an opening and closing tag.
    example:  <element>  This copy will be used for a headline  </element>
    A Style defines how that data will appear with specific attributes: font, font size, color, etc.
    So, say I have an Indesign document that has a predefined paragraph style named: Headline (with attributes of Times New Roman Bold, 18 Point) and I import a file that is tagged like my example. I can map the tag "element" to the style "Headline" and the import can automate the process like this:
    This copy will be used for a headline

  • [CS2][JS] Map tags to styles

    Hi
    I would like to map styles to tags and map tags to styles using a predefined file....
    I've tried using ...
    var thepath="/Volumes/test/Mapping.indd";
    var myImportfile=new File(thepath);
    app.activeDocument.xmlImportMaps.add(myImportfile);
    app.activeDocument.xmlExportMaps.add(myImportfile);
    ... but it raises an error... missing parameter...
    Does anyone have an idea?
    Thanx
    Tim

    Hi Eric,
    I just checked the link, and it's working fine. Try again?
    Also, I'd missed this thread earlier--what Tim is asking about (loading a tag to style mapping from a file) can't be done directly in the user interface (as far as I can tell), so it can't be done directly from scripting. Instead, you'd have to open the file containing the tag to style mapping, then transfer the mapping one import/export map at a time to the target file.
    Thanks,
    Ole

  • Map Tags to Style Pallet Issue

    When in the 'Map Tags to Style' pallet I can't scroll by either moving the scroll bar or clicking up/down arrows. Also the only way to select a style sheet is to click exactly on the paragraph icon. The scrolling is driving me crazy, anyone else have this issue in this pallet in ID CC (using ID from cloud and all updates have been run)?

    Hi,
    Thanks for sharing the document. I tried with your file and scrolling is working fine. I could choose and select the styles also.
    Did the bug happen after importing XML or before as well?
    Do you have other documents open while you are working on this document?
    Did you try cleaning your preferences and cache? If not, you can give this a try and let me know if the problem still remains.
    Regards,
    Pooja

  • Map tags to styles by javascript

    Hi All,
    I need to ‘Map Tags to Styles’ is this possible by javascript?
    By
    hasvi

    Hello hasvi,
    What I understood in Jongware & Everyone statement. You expect everything into this forum, I seen you every post you always expecting or requesting any one to create the script or help. This is not good path to develop to your career. First you have learn then come to forum, then you have any problem, everybody ready to help to you share their knowledge.
    See your below threads Titles. You not share your any ideas to any one also your score is 0. You only get everything into this forum but you not share any small request also.
    How to import tables without 'xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/' this format.
    https://forums.adobe.com/thread/1534167
    How to import tables without 'xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/' this format.
    https://forums.adobe.com/thread/1533132?sr=stream&ru=2170596
    XML structure validation by javascript
    https://forums.adobe.com/thread/1533131?sr=stream&ru=2170596
    Please correct this script for call xml element
    https://forums.adobe.com/thread/1471266
    How to 'import xml' in my script
    https://forums.adobe.com/thread/1531896?sr=stream&ru=2170596
    Need script for "Convert bullets and numbering to text"
    Need script for "Convert bullets and numbering to text"
    Overflow text copy on next page with same anchore box by script
    hasvi
    Again I tell you that don't miss use this forum pls change the attitude. Everybody sharing their thoughts and Ideas to develop only.....
    I hope you understand?
    thx,
    csm_phil

  • Web App name tag capabilities and Upload response handling

    Hi Guys,
    Let me begin by apologising for how long-winded this is going to be. 
    I have set my products up in the ecommerce module utilising catalogues etc - I have removed the buy now and cart options, so the ecommerce module is operating essentially like a showroom.  What I want to do now is link the individual large products to a web app because my product range requires personalization and the customers need to give me information and assetts to get their finished product back - the key for me is getting reports from the system, the web apps are just a portal to those reports.  So the workflow would see them submit their text and assetts to be used in the final product and pay via the web app.  With the web app that takes payment and allows them to submit their personalization stuff I was going to make one per product, so if product a) requires them to submit one block of text and 2 photos, the web app would have corresponding fields.  Then I got thinking about using content holders, the one web app for all products that need one block of text and 2 photos, if I could get the name tag to populate with the product page that sends to it, or the page name the web app form is inserted on, because this will correspond to the large product.  This way when I do the reporting instead of having to report from heaps of web apps, I could just filter the reports by the product name.  It would mean I would only need a handful of web apps vs needing quite a lot, but if it is beyond me I am happy that I have a solution, even if it is a bloated one.
    The other part of this involves me needing to capture the uploaded file name in the web app form fields so I can report from them.  I have been looking around and came across the below code.  My web app will require 1-12 uploaded file names to be captured in 1-12 form fields i.e. img_1 - img_12 - I am not a coder but I wondered whether this had potential for what I need.  It comes from here http://www.openjs.com/articles/ajax/ajax_file_upload/response_data.php
    Thanks in advance for taking the time to digest all of this.
    Mandy
    A Sample Application
    For example, say you are building a photo gallery. When a user uploads an image(using the above mentioned ajax method), you want to get its name and file size from the server side. First, lets create the Javascript uploading script(for explanation on this part, see the Ajax File Upload article)...
    The Code
    <script type="text/javascript"> function init() { document.getElementById("file_upload_form").onsubmit=function() { document.getElementById("file_upload_form").target = "upload_target"; } } </script>  <form id="file_upload_form" method="post" enctype="multipart/form-data" action="upload.php"> <input name="file" id="file" size="27" type="file" /><br /> <input type="submit" name="action" value="Upload Image" /><br /> <iframe id="upload_target" name="upload_target" src="" style="width:100px;height:100px;border:1px solid #ccc;"></iframe> </form> <div id="image_details"></div>
    And the server side(PHP in this case) script will look something like this...
    <?php list($name,$result) = upload('file','image_uploads','jpg,jpeg,gif,png'); if($name) { // Upload Successful $details = stat("image_uploads/$name"); $size = $details['size'] / 1024; print json_encode(array( "success"     =>     $result, "failure"     =>     false, "file_name"     =>     $name,     // Name of the file - JS should get this value "size"          =>     $size     // Size of the file - JS should get this as well. )); } else { // Upload failed for some reason. print json_encode(array( "success"     =>     false, "failure"     =>     $result, )); }
    Here we are printing the data that should be given to JS directly into the iframe. Javascript can access this data by accessing the iframe's DOM. Lets add that part to the JS code...
    function init() { document.getElementById("file_upload_form").onsubmit=function() { document.getElementById("file_upload_form").target = "upload_target"; document.getElementById("upload_target").onload = uploadDone; //This function should be called when the iframe has compleated loading // That will happen when the file is completely uploaded and the server has returned the data we need. } }  function uploadDone() { //Function will be called when iframe is loaded var ret = frames['upload_target'].document.getElementsByTagName("body")[0].innerHTML; var data = eval("("+ret+")"); //Parse JSON // Read the below explanations before passing judgment on me  if(data.success) { //This part happens when the image gets uploaded. document.getElementById("image_details").innerHTML = "<img src='image_uploads/" + data.file_name + "' /><br />Size: " + data.size + " KB"; } else if(data.failure) { //Upload failed - show user the reason. alert("Upload Failed: " + data.failure); } }
    Explanation
    Lets see whats happening here - a play by play commentary...
    document.getElementById("upload_target").onload = uploadDone;
    Set an event handler that will be called when the iframe has compleated loading. That will happen when the file is completely uploaded and the server has returned the data we need. Now lets see the function uploadDone().
    var ret = frames['upload_target'].document.getElementsByTagName("body")[0].innerHTML; var data = eval("("+ret+")");
    These two lines are an eyesore. No - it goes beyond 'eyesore' - this is an abomination. If these lines causes you to gouge out your eyes and run for the hills, I can understand completely. I had to wash my hands after writing those lines. Twice.
    var ret = frames['upload_target'].document.getElementsByTagName("body")[0].innerHTML;
    This will get the data the server side script put in the iframe. This line cannot be avoided as far as I know. You can write it in different ways - but in the end, you will have to take the innerHTML or the nodeValue or something of the body element of the iframe. I used the smallest code in the sample. Even if you specify the Content type of the iframe page as text/plain, the browser will 'domify' it.
    One other thing - in frames['upload_target'] the 'upload_target' is the name of the iframe - not the ID. Its a gotcha you need to be aware of.
    var data = eval("("+ret+")");
    Thankfully, this line can be avoided - you can use some other format(in this particular case the best format might be plain HTML) so that you don't have to parse a string that comes out of innerHTML. Or you can use CSV. Or plain text. Or JSON as we are doing right now - just parse it without using eval(). Reason I choose it? Smallest code - and easier to understand.
    Now we have a working system. The files are uploaded and data reaches the client side. Everything works perfectly. Oh, how I wish I could say that. But nooo - the nightmare of every javascript developer rears its ugly head again...
    Internet Explorer
    Internet Explorer, also known as IE, also known as the Beast, again manages to mess things up. They don't support the onload event for iframe. So the code...
    document.getElementById("upload_target").onload = uploadDone;
    will not work. WILL. NOT. WORK. Thanks IE, thanks very much.
    So, what do we do? We use a small hack. We put a script tag inside the iframe with a onload event that calls the uploadDone() of the top frame. So now the server side script looks like this...
    <html> <head> <script type="text/javascript"> function init() { if(top.uploadDone) top.uploadDone(); //top means parent frame. } window.onload=init; </script> <body> <?php list($name,$result) = upload('file','image_uploads','jpg,jpeg,gif,png'); if($name) { // Upload Successful // Put the PHP content from the last code sample here here } ?> </body> </html>
    Okay - now we have a IE-proof working system. Upload an image using the below demo application to see it in action.
    If you have a better way of doing this, please, PLEASE let me know. I feel dirty doing it this way.
    See it in Action

    You also need to consider when someone removes a product and what happens in terms of the things uploaded.
    Not saying your way wont work but I have the structure for this basically very similar on sites already that covers all the basis of real world use and works well.
    Mine is future proof anyway. BC will never ( I have it in writing) replace the code because it will break implementations and sites directly. jquery version is on the cards but the way that will be implemented or any change will either be with notice and on new sites not old or like many features an option in the admin to change it.

  • How to handle paragraph styles in imported text with no tagged paragraph styles

    Hi
    Im currently trying to import a file (word file / excel I have both formats) into an indesign book and formatting the text automatically!
    My question is: How is it possible to reflow text into frames and when changing frame it changes paragraph?
    Or how is it possible to change paragraph style when forcing a line break when using text reflow?
    I have already figured out how to reflow the text, and actually also managed to relow text into the frames and change paragraph style. I know how to use the keep option, and by this change the paragraph style when e.g. changing frame break/page break etc.  (but if the content being flowed-in is not tagged with style names then I cannot figure out how to do it) The document and its content I whish to import do not have any tagged paragraphs!
    Then I tried to look into "object styles" and format a text frame on a master page with an object style, and by using a "dilimiter character" forcing the text to start in a new frame when bringing the frame into live on a page. But here I cannot make the "text frame/object style" to apply or to work.
    If any of you have a hint, I would be more than happy to hear from you
    This picture are illustrating the outcome I would to get to....

    If the incoming text does not have styles, or has only one style, there is really not much you can do other than assign styles after the import. If there are recognizable patterns in the formatting, a lot of that can be done with Find/Change, and there are a few scripts floating around that can help automate some of that.
    Also, if your styles have a a good "next style" heirarchy built in, you can select large blocks of text (up to the point where applying next style would be incorrect), then right click the style name in the paragraph styles panel and choose apply style and next style (remove overrides). Warning. Removing overrides will remove any locally applied formatting like bold or italics, so local formatting should be converted to character styles first. Applied character styles are not overrides and will be preserved.

  • After a search of the bookmark library for a certain bookmark (and search finds it), how do you then tell what folder it is in? There should be a 'Folder' column in the title line like this, Name, Tags,Folder,Location. Thank you.

    A search of the Library bookmarks should provide each bookmark's folder as well as Name, Tags, and Location.
    As it is now, a search (for example) for the string 'IESI', a refuse collection company in Central Texas, actually finds IESI. But what if you cannot remember what folder you put the IESI bookmark in? Current search fails to provide folder information.

    See:
    *Show Parent Folder: https://addons.mozilla.org/firefox/addon/show-parent-folder/
    *Go Parent Folder: https://addons.mozilla.org/firefox/addon/go-parent-folder/

  • How do I keep the name tags in Picasa Web Albums from appearing on the images by default? With Explorer, name tags only appear when mousing over the image, but with Firefox, all the tags appear on the picture as soon as it is loaded, which looks messy.

    I use Picasa to create web albums, and I tag people who appear in the pictures. With Explorer, the name tags do not appear on the pictures until I mouse over a specific person, at which point the tag appears. With Firefox, the name tags appear as soon as the picture is loaded, and only disappear when you mouse over the people in the picture. This makes the picture look messy; by default, one would want to see a picture without tags all over people's faces.
    The only way to "fix" this is to disable the name tags completely (or tell people to use Explorer!), but this is not an ideal solution, since I would like to be able to share albums with people's names in them.

    I use Picasa to create web albums, and I tag people who appear in the pictures. With Explorer, the name tags do not appear on the pictures until I mouse over a specific person, at which point the tag appears. With Firefox, the name tags appear as soon as the picture is loaded, and only disappear when you mouse over the people in the picture. This makes the picture look messy; by default, one would want to see a picture without tags all over people's faces.
    The only way to "fix" this is to disable the name tags completely (or tell people to use Explorer!), but this is not an ideal solution, since I would like to be able to share albums with people's names in them.

  • Name Tags

    I would like to be able to print name tags from a database... Can anyone help me figure out how to do this?
    Thanks!

    Appleworks is my favorite program for the task for the very reasons you mention.
    First, it is dirt easy to create a new database and Appleworks has a template included for contacts.
    Once you have entered the data you create different layouts. For example, in one contact database I have multiple layouts. Example:
    1. Layout 1 Print out all the contacts in Roster format.
    2. Layout 2 is name tags for seats
    3. Layout 3 is address labels.
    4. Layout 4 is a calling checklist.
    All these layouts I created in one database! Pretty darn slick.
    There have been many complaints about Pages limited mail merge. It only communicates with Address Book. Appleworks Word Processing files do mail merge from any Appleworks database and any field. As mentioned previously, you can create layouts within the database to print out the info.
    Hesitancy to recommend Appleworks comes from its lack of development, although it has been mentioned elsewhere that Appleworks runs well on Intel Macs.
    If you want to work with Pages consider creating a new group in Address Book with the contact names you wish. At the end of the project you can delete all the contacts by selecting a the group, selecting a contact in the group, press ⌘ + A to select all contacts and then press delete. When it asks how you want to delete the contact make sure you select, delete from Address Book.
    Kurt

  • Default Mapping Program name in SEEBURGER Adapter

    Hi all,
    Can any one help me with the default Mapping Program names supplied by SEEBURGER for EDIFACT D96a---->XML  and Vice versa.
    your help will be appreciated.
    Thanks
    Gopi

    Hello Gopi,
    It is as follows (I am assuming your EDIFACT message is:
    ORDERS_UN_D96A)
    E2X - <b>See_E2X_ORDERS_UN_D96A</b>
    X2E-  <b>See_X2E_ORDERS_UN_D96A</b>
    Thanks
    Abinash

Maybe you are looking for

  • Scheduling Error For Web Intelligence Reports

    Dear Experts,     I want schedule BO XI R3.1 SP 3  Web Intelligence reports.     For this i want to give  Adaptive job server :destination details.     Can you suggest what i need to enter for below details?    1)Host    ?    2)Port?    3)Domain Name

  • Error occured When I migrated my APP from JSF1.1 to JSF1.2 in Tomcat6.X

    Recently, I accepted a work from my leader that migrate the exist web application based JSF from JSF1.1 to JSF1.2. Because JSF1.2 must be run in those web servers that implementsJSP2.1 I downloaded Tomcat6.X from apache and put jsf-impl.jar together

  • Regarding creating a Mail List Manager  ..pls suggest

    Hi, I am trying to create a very primitive Mailing List Manager for general usage. I am facing a few issues and would be greatful if i could get them clarified. 1.I requier a smtp server that will create group accounts, i tried using a few mail serve

  • SqlDeveloper Issue -

    Hi Masters! I have an issue, with the sqldeveloper, there is a filter that sends some different values using a field that is varchar2, which is being selected as follows: Select * from postcode_lookup where postcode = '3034'; And it is sending some d

  • Setting Specific Color for Outer Glows?

    Hi, I'm trying to set up an outer glow around some text (which is black text) and the glow keeps showing up as yellow. I want it to be white (like a cloud). Is there some way to get it to do this? Or am I stuck with yellow (which I don't understand w