Forum Replies Created
-
AuthorPosts
-
Michael Angelo
MemberHi Peter,
Your path “https://kasyan.ho.com.ua/place_images.html” doesn’t exist. Please provide one, I badly needed this script too. Thanks.
Michael Angelo
MemberWhat an another brilliant script from Jongware. This is very effective guys. More power to you.
Michael Angelo
MemberMany thanks Loic, your script works. You’re great!
Michael Angelo
MemberYou are really amazing Theunis De Jong. Your script are brilliant, it help us a lot here. You are really one of the InDesign master here.
Michael Angelo
MemberHi Obi-wan, you’re right. I’m sorry if I didn’t clear it. We used “Insert Special Character > Marker > Current Page Number” to be inserted on MasterPage to auto page a document. Unfortunately, our client wants to format a page number when it reach on a 4-digit pages (ex., 1,000; 1,001; 1,002…) which is no option in Numbering & Section option in InDesign. That’s why I’m looking for a script to avoid manualing.
Thanks for your suggestion David and Kai.
This site really helped us a lot. I was overwhelmed by the help of everyone. More power to this site and also to all of you guys.
Sorry for my bad english :)
Michael Angelo
MemberHi Obi-wan,
Your code works, thanks. But I want to change the page number itself which is not allowed in page numbering in InDesign.
Page number is set as a variable in my document, FYI. Please help me with this.
Michael Angelo
MemberThanks Loic. Unfortunately, I also receive an error with the script. But this one works…
var doc = app.activeDocument;
var myRuleSet = new Array (new Function1)
with(doc)
{
var elements = xmlElements;
__processRuleSet(elements.item(0), myRuleSet);
}function Function1()
{
this.name = “Function1”;
this.xpath = “//article”;
this.apply = function(myElement, myRuleProcessor)
{
with(myElement)
{
var ec=myElement.xmlElements.count();
$.writeln(ec);
for(var i=0; i<ec; i++)
{
if(myElement.xmlElements[i].markupTag.name==”<tag_name_being_deleted>”)
{
myElement.xmlElements[i].remove();
}}}
return false;
}// alert(“Process completed”);
//Built in function starts here.
function __processRuleSet (root, ruleSet, prefixMappingTable)
{
var mainRProcessor = __makeRuleProcessor(ruleSet, prefixMappingTable);try {
__processTree(root, mainRProcessor);
__deleteRuleProcessor(mainRProcessor);
} catch (e) {
__deleteRuleProcessor(mainRProcessor);
throw e;
}
}function __makeRuleProcessor(ruleSet, prefixMappingTable){
// Get the condition paths of all the rules.
var pathArray = new Array();
for (i=0; i<ruleSet.length; i++)
{pathArray.push(ruleSet[i].xpath);}
try
{var ruleProcessor = app.xmlRuleProcessors.add(pathArray, prefixMappingTable);}
catch(e){throw e;}
var rProcessor = new ruleProcessorObject(ruleSet, ruleProcessor);
return rProcessor;}function ruleProcessorObject(ruleSet, ruleProcessor)
{this.ruleSet = ruleSet;
this.ruleProcessor = ruleProcessor;}function __deleteRuleProcessor(rProcessor) {
// remove the XMLRuleProcessor object
rProcessor.ruleProcessor.remove();// delete the object properties
delete rProcessor.ruleProcessor;
delete rProcessor.ruleSet;// delete the object itself
delete rProcessor;
}function __processTree (root, rProcessor)
{
var ruleProcessor = rProcessor.ruleProcessor;
try
{var matchData = ruleProcessor.startProcessingRuleSet(root);
__processMatchData(matchData, rProcessor);
ruleProcessor.endProcessingRuleSet();}
catch (e)
{ruleProcessor.endProcessingRuleSet();
throw e;}}function __processMatchData(matchData, rProcessor)
{var ruleProcessor = rProcessor.ruleProcessor;
var ruleSet = rProcessor.ruleSet;
while (matchData != undefined)
{var element = matchData.element;
var matchRules = matchData.matchRules;
var applyMatchedRules = true;for (var i=0; i<matchRules.length && applyMatchedRules && !ruleProcessor.halted; i++)
{applyMatchedRules = (false == ruleSet[matchRules[i]].apply(element, rProcessor));}
matchData = ruleProcessor.findNextMatch();}} -
AuthorPosts
