omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Getting selection between two headers (or other bracketing symbols)

    Editorial
    1
    2
    1771
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AlexKucera
      AlexKucera last edited by

      I'm trying to build a workflow that allows me to extract the text between two headings into a new document. However, I have no idea how to automate the selection process.

      Right now I present a list of headings, where the user can select a heading that he wants to extract into a new document. That gets me the selection start. For the end of my selection, I currently present the same list and one simply clicks on the next heading.

      Ideally, I want to omit that second list and simply grab everything from the selection start to the next heading. I just have no idea how to get there. I assume a Python script is the way to go. No idea how to go about it though.

      1 Reply Last reply Reply Quote 0
      • AlexKucera
        AlexKucera last edited by

        Got it to work with a Python script that does a re.search for a multiline RegEx and then outputting the resulting index with re.search.start().

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors