highlight text or XML to comment










0















I have a long text like this with many comments to create from a specific text in bold or XML tags:



Lorem ipsum dolor sit amet, consectetur adipiscing elit.



or also I can format like this:



<.XML.>Lorem< /XML.> ipsum dolor sit amet, <.XML>consectetur adipiscing< /XML> elit.



Please how can I convert the text in highlight or bold, or XML tags, etc...



in comments in Google doc using app script?



The final result in Google doc need be like this:
https://photos.app.goo.gl/pUugcKRHupqzZepBA



Thanks so much for read!



Here I find some documentation:



Google Script



Some post










share|improve this question
























  • Can you provide your latest script? I think that it will help users think of your solution.

    – Tanaike
    Nov 14 '18 at 22:04











  • Hi Tanaike, I haven't any script. I start from scratch. I only have a simple word.docx with many hightlight text. Sorry.

    – fireDevelop.com
    Nov 14 '18 at 22:48











  • Thank you for replying. For example, how about using replaceText() and findText() to your situation? When you want to know about Google Apps Script, you can see the document at here. If this was not what you want, I'm sorry.

    – Tanaike
    Nov 14 '18 at 22:54











  • Hi, maybe I didn't explain well. I try to create a comment automatic in Google Doc. For example if you have this text: hello world. With the letter world in bold, I want create a comment in the word world with the text world. I need create over 1500 comments many times, for this reason a need some script. thanks!

    – fireDevelop.com
    Nov 14 '18 at 23:31












  • I'm really sorry my comment was not useful for your situation.

    – Tanaike
    Nov 14 '18 at 23:32















0















I have a long text like this with many comments to create from a specific text in bold or XML tags:



Lorem ipsum dolor sit amet, consectetur adipiscing elit.



or also I can format like this:



<.XML.>Lorem< /XML.> ipsum dolor sit amet, <.XML>consectetur adipiscing< /XML> elit.



Please how can I convert the text in highlight or bold, or XML tags, etc...



in comments in Google doc using app script?



The final result in Google doc need be like this:
https://photos.app.goo.gl/pUugcKRHupqzZepBA



Thanks so much for read!



Here I find some documentation:



Google Script



Some post










share|improve this question
























  • Can you provide your latest script? I think that it will help users think of your solution.

    – Tanaike
    Nov 14 '18 at 22:04











  • Hi Tanaike, I haven't any script. I start from scratch. I only have a simple word.docx with many hightlight text. Sorry.

    – fireDevelop.com
    Nov 14 '18 at 22:48











  • Thank you for replying. For example, how about using replaceText() and findText() to your situation? When you want to know about Google Apps Script, you can see the document at here. If this was not what you want, I'm sorry.

    – Tanaike
    Nov 14 '18 at 22:54











  • Hi, maybe I didn't explain well. I try to create a comment automatic in Google Doc. For example if you have this text: hello world. With the letter world in bold, I want create a comment in the word world with the text world. I need create over 1500 comments many times, for this reason a need some script. thanks!

    – fireDevelop.com
    Nov 14 '18 at 23:31












  • I'm really sorry my comment was not useful for your situation.

    – Tanaike
    Nov 14 '18 at 23:32













0












0








0








I have a long text like this with many comments to create from a specific text in bold or XML tags:



Lorem ipsum dolor sit amet, consectetur adipiscing elit.



or also I can format like this:



<.XML.>Lorem< /XML.> ipsum dolor sit amet, <.XML>consectetur adipiscing< /XML> elit.



Please how can I convert the text in highlight or bold, or XML tags, etc...



in comments in Google doc using app script?



The final result in Google doc need be like this:
https://photos.app.goo.gl/pUugcKRHupqzZepBA



Thanks so much for read!



Here I find some documentation:



Google Script



Some post










share|improve this question
















I have a long text like this with many comments to create from a specific text in bold or XML tags:



Lorem ipsum dolor sit amet, consectetur adipiscing elit.



or also I can format like this:



<.XML.>Lorem< /XML.> ipsum dolor sit amet, <.XML>consectetur adipiscing< /XML> elit.



Please how can I convert the text in highlight or bold, or XML tags, etc...



in comments in Google doc using app script?



The final result in Google doc need be like this:
https://photos.app.goo.gl/pUugcKRHupqzZepBA



Thanks so much for read!



Here I find some documentation:



Google Script



Some post







google-apps-script google-docs highlight






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 23:54







fireDevelop.com

















asked Nov 14 '18 at 20:56









fireDevelop.comfireDevelop.com

33




33












  • Can you provide your latest script? I think that it will help users think of your solution.

    – Tanaike
    Nov 14 '18 at 22:04











  • Hi Tanaike, I haven't any script. I start from scratch. I only have a simple word.docx with many hightlight text. Sorry.

    – fireDevelop.com
    Nov 14 '18 at 22:48











  • Thank you for replying. For example, how about using replaceText() and findText() to your situation? When you want to know about Google Apps Script, you can see the document at here. If this was not what you want, I'm sorry.

    – Tanaike
    Nov 14 '18 at 22:54











  • Hi, maybe I didn't explain well. I try to create a comment automatic in Google Doc. For example if you have this text: hello world. With the letter world in bold, I want create a comment in the word world with the text world. I need create over 1500 comments many times, for this reason a need some script. thanks!

    – fireDevelop.com
    Nov 14 '18 at 23:31












  • I'm really sorry my comment was not useful for your situation.

    – Tanaike
    Nov 14 '18 at 23:32

















  • Can you provide your latest script? I think that it will help users think of your solution.

    – Tanaike
    Nov 14 '18 at 22:04











  • Hi Tanaike, I haven't any script. I start from scratch. I only have a simple word.docx with many hightlight text. Sorry.

    – fireDevelop.com
    Nov 14 '18 at 22:48











  • Thank you for replying. For example, how about using replaceText() and findText() to your situation? When you want to know about Google Apps Script, you can see the document at here. If this was not what you want, I'm sorry.

    – Tanaike
    Nov 14 '18 at 22:54











  • Hi, maybe I didn't explain well. I try to create a comment automatic in Google Doc. For example if you have this text: hello world. With the letter world in bold, I want create a comment in the word world with the text world. I need create over 1500 comments many times, for this reason a need some script. thanks!

    – fireDevelop.com
    Nov 14 '18 at 23:31












  • I'm really sorry my comment was not useful for your situation.

    – Tanaike
    Nov 14 '18 at 23:32
















Can you provide your latest script? I think that it will help users think of your solution.

– Tanaike
Nov 14 '18 at 22:04





Can you provide your latest script? I think that it will help users think of your solution.

– Tanaike
Nov 14 '18 at 22:04













Hi Tanaike, I haven't any script. I start from scratch. I only have a simple word.docx with many hightlight text. Sorry.

– fireDevelop.com
Nov 14 '18 at 22:48





Hi Tanaike, I haven't any script. I start from scratch. I only have a simple word.docx with many hightlight text. Sorry.

– fireDevelop.com
Nov 14 '18 at 22:48













Thank you for replying. For example, how about using replaceText() and findText() to your situation? When you want to know about Google Apps Script, you can see the document at here. If this was not what you want, I'm sorry.

– Tanaike
Nov 14 '18 at 22:54





Thank you for replying. For example, how about using replaceText() and findText() to your situation? When you want to know about Google Apps Script, you can see the document at here. If this was not what you want, I'm sorry.

– Tanaike
Nov 14 '18 at 22:54













Hi, maybe I didn't explain well. I try to create a comment automatic in Google Doc. For example if you have this text: hello world. With the letter world in bold, I want create a comment in the word world with the text world. I need create over 1500 comments many times, for this reason a need some script. thanks!

– fireDevelop.com
Nov 14 '18 at 23:31






Hi, maybe I didn't explain well. I try to create a comment automatic in Google Doc. For example if you have this text: hello world. With the letter world in bold, I want create a comment in the word world with the text world. I need create over 1500 comments many times, for this reason a need some script. thanks!

– fireDevelop.com
Nov 14 '18 at 23:31














I'm really sorry my comment was not useful for your situation.

– Tanaike
Nov 14 '18 at 23:32





I'm really sorry my comment was not useful for your situation.

– Tanaike
Nov 14 '18 at 23:32












1 Answer
1






active

oldest

votes


















0














I show you how to convert Adobe InDesign index into Word or Google Doc comments.



1º VIDEO:
https://youtu.be/_M1TaOgCYkU



2º IMAGES GALLERY:
https://photos.app.goo.gl/W2uvndiyujFby1X8A



3º ADOBE INDESIGN SCRIPT :



// Project name: id0000131-convert-index-entries-into-Word-or-Google-Doc-comments
// Github: Adobe Indesign Script examples: https://github.com/firedevelop/id0000013-Adobe-InDesign-Scripts-Examples
// Github of this project: id0000131-convert-adobe-indesign-index-into-Word-or-Google-Doc-comments
// YouTube Playlist: https://www.youtube.com/playlist?list=PLfdbMQ5CoohPqK8ekjthm2fNoGMLwYeFf
// Blog: https://www.firedevelop.com/2018/11/id0000131-convert-index-entries-into.html

// Script Author:
// Peter Kahrel -- www.kahrel.plus.com
// http://www.kahrel.plus.com/indesign/index-to-text.jsx
// http://www.kahrel.plus.com/indesign/index_to_text.html



(function ()

function addSortOrder (topic)
var s = topic.name;
if (topic.sortOrder !== '')
s += '@' + topic.sortOrder;

return s;


function topicPath (topic, str)
if (topic.parent.constructor.name == 'Index')
return str;
else
return topicPath (topic.parent, addSortOrder (topic.parent) + '#' + str);



function main ()
var i, j;
var topics;
var err = false;
if (app.documents[0].indexes.length === 0)
alert ('Document doesn't have an index.');
exit();

topics = app.documents[0].indexes[0].allTopics;
for (i = topics.length-1; i >= 0; i--)
for (j = topics[i].pageReferences.length-1; j > -1; j--)
try
topics[i].pageReferences[j].sourceText.contents = '<!-- ' + topicPath (topics[i], addSortOrder (topics[i])) + ' -->';
//topics[i].pageReferences[j].remove();
catch (_)
err = true;



if (err)
alert ('Some markers could not be converted. Please check the Index panel');



main();

());





share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53308595%2fhighlight-text-or-xml-to-comment%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I show you how to convert Adobe InDesign index into Word or Google Doc comments.



    1º VIDEO:
    https://youtu.be/_M1TaOgCYkU



    2º IMAGES GALLERY:
    https://photos.app.goo.gl/W2uvndiyujFby1X8A



    3º ADOBE INDESIGN SCRIPT :



    // Project name: id0000131-convert-index-entries-into-Word-or-Google-Doc-comments
    // Github: Adobe Indesign Script examples: https://github.com/firedevelop/id0000013-Adobe-InDesign-Scripts-Examples
    // Github of this project: id0000131-convert-adobe-indesign-index-into-Word-or-Google-Doc-comments
    // YouTube Playlist: https://www.youtube.com/playlist?list=PLfdbMQ5CoohPqK8ekjthm2fNoGMLwYeFf
    // Blog: https://www.firedevelop.com/2018/11/id0000131-convert-index-entries-into.html

    // Script Author:
    // Peter Kahrel -- www.kahrel.plus.com
    // http://www.kahrel.plus.com/indesign/index-to-text.jsx
    // http://www.kahrel.plus.com/indesign/index_to_text.html



    (function ()

    function addSortOrder (topic)
    var s = topic.name;
    if (topic.sortOrder !== '')
    s += '@' + topic.sortOrder;

    return s;


    function topicPath (topic, str)
    if (topic.parent.constructor.name == 'Index')
    return str;
    else
    return topicPath (topic.parent, addSortOrder (topic.parent) + '#' + str);



    function main ()
    var i, j;
    var topics;
    var err = false;
    if (app.documents[0].indexes.length === 0)
    alert ('Document doesn't have an index.');
    exit();

    topics = app.documents[0].indexes[0].allTopics;
    for (i = topics.length-1; i >= 0; i--)
    for (j = topics[i].pageReferences.length-1; j > -1; j--)
    try
    topics[i].pageReferences[j].sourceText.contents = '<!-- ' + topicPath (topics[i], addSortOrder (topics[i])) + ' -->';
    //topics[i].pageReferences[j].remove();
    catch (_)
    err = true;



    if (err)
    alert ('Some markers could not be converted. Please check the Index panel');



    main();

    ());





    share|improve this answer



























      0














      I show you how to convert Adobe InDesign index into Word or Google Doc comments.



      1º VIDEO:
      https://youtu.be/_M1TaOgCYkU



      2º IMAGES GALLERY:
      https://photos.app.goo.gl/W2uvndiyujFby1X8A



      3º ADOBE INDESIGN SCRIPT :



      // Project name: id0000131-convert-index-entries-into-Word-or-Google-Doc-comments
      // Github: Adobe Indesign Script examples: https://github.com/firedevelop/id0000013-Adobe-InDesign-Scripts-Examples
      // Github of this project: id0000131-convert-adobe-indesign-index-into-Word-or-Google-Doc-comments
      // YouTube Playlist: https://www.youtube.com/playlist?list=PLfdbMQ5CoohPqK8ekjthm2fNoGMLwYeFf
      // Blog: https://www.firedevelop.com/2018/11/id0000131-convert-index-entries-into.html

      // Script Author:
      // Peter Kahrel -- www.kahrel.plus.com
      // http://www.kahrel.plus.com/indesign/index-to-text.jsx
      // http://www.kahrel.plus.com/indesign/index_to_text.html



      (function ()

      function addSortOrder (topic)
      var s = topic.name;
      if (topic.sortOrder !== '')
      s += '@' + topic.sortOrder;

      return s;


      function topicPath (topic, str)
      if (topic.parent.constructor.name == 'Index')
      return str;
      else
      return topicPath (topic.parent, addSortOrder (topic.parent) + '#' + str);



      function main ()
      var i, j;
      var topics;
      var err = false;
      if (app.documents[0].indexes.length === 0)
      alert ('Document doesn't have an index.');
      exit();

      topics = app.documents[0].indexes[0].allTopics;
      for (i = topics.length-1; i >= 0; i--)
      for (j = topics[i].pageReferences.length-1; j > -1; j--)
      try
      topics[i].pageReferences[j].sourceText.contents = '<!-- ' + topicPath (topics[i], addSortOrder (topics[i])) + ' -->';
      //topics[i].pageReferences[j].remove();
      catch (_)
      err = true;



      if (err)
      alert ('Some markers could not be converted. Please check the Index panel');



      main();

      ());





      share|improve this answer

























        0












        0








        0







        I show you how to convert Adobe InDesign index into Word or Google Doc comments.



        1º VIDEO:
        https://youtu.be/_M1TaOgCYkU



        2º IMAGES GALLERY:
        https://photos.app.goo.gl/W2uvndiyujFby1X8A



        3º ADOBE INDESIGN SCRIPT :



        // Project name: id0000131-convert-index-entries-into-Word-or-Google-Doc-comments
        // Github: Adobe Indesign Script examples: https://github.com/firedevelop/id0000013-Adobe-InDesign-Scripts-Examples
        // Github of this project: id0000131-convert-adobe-indesign-index-into-Word-or-Google-Doc-comments
        // YouTube Playlist: https://www.youtube.com/playlist?list=PLfdbMQ5CoohPqK8ekjthm2fNoGMLwYeFf
        // Blog: https://www.firedevelop.com/2018/11/id0000131-convert-index-entries-into.html

        // Script Author:
        // Peter Kahrel -- www.kahrel.plus.com
        // http://www.kahrel.plus.com/indesign/index-to-text.jsx
        // http://www.kahrel.plus.com/indesign/index_to_text.html



        (function ()

        function addSortOrder (topic)
        var s = topic.name;
        if (topic.sortOrder !== '')
        s += '@' + topic.sortOrder;

        return s;


        function topicPath (topic, str)
        if (topic.parent.constructor.name == 'Index')
        return str;
        else
        return topicPath (topic.parent, addSortOrder (topic.parent) + '#' + str);



        function main ()
        var i, j;
        var topics;
        var err = false;
        if (app.documents[0].indexes.length === 0)
        alert ('Document doesn't have an index.');
        exit();

        topics = app.documents[0].indexes[0].allTopics;
        for (i = topics.length-1; i >= 0; i--)
        for (j = topics[i].pageReferences.length-1; j > -1; j--)
        try
        topics[i].pageReferences[j].sourceText.contents = '<!-- ' + topicPath (topics[i], addSortOrder (topics[i])) + ' -->';
        //topics[i].pageReferences[j].remove();
        catch (_)
        err = true;



        if (err)
        alert ('Some markers could not be converted. Please check the Index panel');



        main();

        ());





        share|improve this answer













        I show you how to convert Adobe InDesign index into Word or Google Doc comments.



        1º VIDEO:
        https://youtu.be/_M1TaOgCYkU



        2º IMAGES GALLERY:
        https://photos.app.goo.gl/W2uvndiyujFby1X8A



        3º ADOBE INDESIGN SCRIPT :



        // Project name: id0000131-convert-index-entries-into-Word-or-Google-Doc-comments
        // Github: Adobe Indesign Script examples: https://github.com/firedevelop/id0000013-Adobe-InDesign-Scripts-Examples
        // Github of this project: id0000131-convert-adobe-indesign-index-into-Word-or-Google-Doc-comments
        // YouTube Playlist: https://www.youtube.com/playlist?list=PLfdbMQ5CoohPqK8ekjthm2fNoGMLwYeFf
        // Blog: https://www.firedevelop.com/2018/11/id0000131-convert-index-entries-into.html

        // Script Author:
        // Peter Kahrel -- www.kahrel.plus.com
        // http://www.kahrel.plus.com/indesign/index-to-text.jsx
        // http://www.kahrel.plus.com/indesign/index_to_text.html



        (function ()

        function addSortOrder (topic)
        var s = topic.name;
        if (topic.sortOrder !== '')
        s += '@' + topic.sortOrder;

        return s;


        function topicPath (topic, str)
        if (topic.parent.constructor.name == 'Index')
        return str;
        else
        return topicPath (topic.parent, addSortOrder (topic.parent) + '#' + str);



        function main ()
        var i, j;
        var topics;
        var err = false;
        if (app.documents[0].indexes.length === 0)
        alert ('Document doesn't have an index.');
        exit();

        topics = app.documents[0].indexes[0].allTopics;
        for (i = topics.length-1; i >= 0; i--)
        for (j = topics[i].pageReferences.length-1; j > -1; j--)
        try
        topics[i].pageReferences[j].sourceText.contents = '<!-- ' + topicPath (topics[i], addSortOrder (topics[i])) + ' -->';
        //topics[i].pageReferences[j].remove();
        catch (_)
        err = true;



        if (err)
        alert ('Some markers could not be converted. Please check the Index panel');



        main();

        ());






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 16 '18 at 14:40









        fireDevelop.comfireDevelop.com

        33




        33





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53308595%2fhighlight-text-or-xml-to-comment%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Use pre created SQLite database for Android project in kotlin

            Darth Vader #20

            Ondo