🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
7 messages
7 total messages Started by Richard_Holstein Wed, 04 Feb 2009 17:05
map by name, Tags to Styles
#1500
Author: Richard_Holstein
Date: Wed, 04 Feb 2009 17:05
4 lines
650 bytes
In JavaScript, I can map Styles to Tags using autoTag but how do I map Tags to Styles by name?

Thank you,
Richard
Re: map by name, Tags to Styles
#1508
Author: Kasyan_Servetsky
Date: Thu, 05 Feb 2009 06:35
6 lines
775 bytes
Hi Richard,

Check out MapTagsToStyles.jsx example script from here:
 <http://wwwimages.adobe.com/www.adobe.com/products/indesign/scripting/downloads/indesign_cs3_guide_scripts.zip>

Kasyan
Re: map by name, Tags to Styles
#1533
Author: Richard_Holstein
Date: Thu, 05 Feb 2009 17:53
8 lines
977 bytes
Hi Kasyan,

Hum...I probably did not explain myself very well.

Assume that tags have been created matching all paragraphs and characters styles and that "Map Styles to Tags" is done with "Map by Name". The only thing left for me to do, is now to "Map Tags to Styles" with "Map by Name". This last step is where I fail.

Thanks,
Richard
Re: map by name, Tags to Styles
#1540
Author: Kasyan_Servetsky
Date: Thu, 05 Feb 2009 19:24
31 lines
1396 bytes


 
#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;
   }
}
Re: map by name, Tags to Styles
#1414
Author: Richard_Holstein
Date: Fri, 06 Feb 2009 13:31
4 lines
724 bytes
Thank you Kasyan, at first glance this is working well. Let me pass it through some more exercises and I will report.

Thanks again,
Richard
Re: map by name, Tags to Styles
#1415
Author: Stefan_Rakete
Date: Fri, 06 Feb 2009 13:48
4 lines
692 bytes
Richard,
another way to go is with the XMLExportMap

Stefan
Re: map by name, Tags to Styles
#1431
Author: Richard_Holstein
Date: Sat, 07 Feb 2009 20:38
4 lines
646 bytes
Stefan,
Thank you, I will try it also.

Richard
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads