Back

If your email is not recognized and you believe it should be, please contact us.

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: Help creating a loop #99229

    Hi Peter,

    Your path “https://kasyan.ho.com.ua/place_images.html” doesn’t exist. Please provide one, I badly needed this script too. Thanks.

    in reply to: Create text frame from selected text? #95793

    What an another brilliant script from Jongware. This is very effective guys. More power to you.

    in reply to: Script to Tag selected text and add attributes #95625

    Many thanks Loic, your script works. You’re great!

    in reply to: Finding objects of particular Object Style #95565

    You 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.

    in reply to: Script to add comma on a 4-digit page #95208

    Hi 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 :)

    in reply to: Script to add comma on a 4-digit page #95147

    Hi 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.

    in reply to: Script to search for an XML tag and remove it #94372

    Thanks 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();}}

Viewing 7 posts - 1 through 7 (of 7 total)