• Login
Community
  • Login

Help with generating clickable links or something of that sort

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
17 Posts 4 Posters 945 Views
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.
  • S
    someOtherKun
    last edited by Jun 15, 2020, 9:26 PM

    Hi, im new here

    I’ve started working in this todo setup for the past couple of days which is just a bat file(for now) that sorts the tasks based on priority, due-date and task type (the performance was poor. now its handling 10k+ lines in ~2 secs).

    asdf.png

    I ran into some issues while working on this

    • delimiter breaking the code folding. i did find a issue for this. so its is fine. i’ll just start folding at the beginning of the line

    • delimiter with a single line comment at the of the same line makes the delimiter highlighting go to the next line in search of ((EOL)). i couldn’t find any for this. am i missing something here?

    the last thing I want to display the tasks in the right-side panel as npp-task-list does but im afraid that i dont own a good setup to run something like MS Visual Studio. making a plugin is not on the table for me since i lack both the expertise and the fact that im hanging on a toaster doesn’t help
    so i looked into some other options like python scripter and lua script . i dont know how to code in these.

    I copied a line from here to make a clickable link but it shows something that looks as if im reading hexadecimal code

    I just want to make use of that text file and goto the lines in that order without having to switch between cmd and np++

    appreciate any help

    S 1 Reply Last reply Jun 15, 2020, 10:39 PM Reply Quote 0
    • S
      someOtherKun @someOtherKun
      last edited by someOtherKun Jun 15, 2020, 10:41 PM Jun 15, 2020, 10:39 PM

      ah, i edited the time.py file in python scripter to print todays date. i think, i can now use regex to replace a “<[0-9]+>” into due date for convenience. but still cant figure out the clickable link part though

      I forgot to mention this before, does manually editing the udl.xml file to increase delimiters work?

      E 1 Reply Last reply Jun 17, 2020, 10:23 PM Reply Quote 0
      • E
        Ekopalypse @someOtherKun
        last edited by Jun 17, 2020, 10:23 PM

        @someOtherKun

        I’m not really sure what you try to achieve.
        Do you want to build the dialog on the right side, the one with 00003 … with clickable links?

        J 1 Reply Last reply Jun 18, 2020, 11:40 AM Reply Quote 0
        • J
          jakima
          last edited by jakima Jun 18, 2020, 10:48 AM Jun 18, 2020, 10:47 AM

          yes i want to create clickable links that take me to a line with the same number using that text file

          btw this is my new one. for some reason that acc got flagged

          E 1 Reply Last reply Jun 18, 2020, 11:43 AM Reply Quote 1
          • J
            jakima @Ekopalypse
            last edited by Jun 18, 2020, 11:40 AM

            @Ekopalypse
            this is the only proof i have regarding the fact that im the one who posted this
            tinyurl com/npptodopost

            1 Reply Last reply Reply Quote 1
            • E
              Ekopalypse @jakima
              last edited by Jun 18, 2020, 11:43 AM

              @jakima

              wait, let me try to get this right.
              Your goal is to run a cmd/batch file and the result of that batch file
              contains links which you want to click and those will bring you to the location in that file, correct?

              Like in this example
              4678731f-6f3a-462b-ba3b-c359c913b6d7-image.png

              If I would click on the link in the Python console it would
              a) open the file test.py and
              b) set the caret to line 2

              Is it that what you try to achieve?

              J 2 Replies Last reply Jun 18, 2020, 12:32 PM Reply Quote 1
              • J
                jakima @Ekopalypse
                last edited by Jun 18, 2020, 12:32 PM

                @Ekopalypse
                exactly

                1 Reply Last reply Reply Quote 0
                • J
                  jakima @Ekopalypse
                  last edited by jakima Jun 18, 2020, 12:54 PM Jun 18, 2020, 12:53 PM

                  @Ekopalypse
                  can i manually generate such links in console? using python scripter of course

                  E 1 Reply Last reply Jun 18, 2020, 1:06 PM Reply Quote 0
                  • E
                    Ekopalypse @jakima
                    last edited by Jun 18, 2020, 1:06 PM

                    @jakima

                    yes you can, assuming the following batch file

                    @echo off
                    SET a=  File
                    SET b=, line 3, in
                    SET c=%a% "%0"%b%
                    echo %c%
                    

                    and calling the batch from either the console or via script with

                    console.run(r"cmd.exe /c d:\mybatch.bat")

                    would result in something like

                    db601700-b891-4fbd-9ab8-ce9e519db85a-image.png

                    and clicking on the link will do what I assume you want to do.

                    J 1 Reply Last reply Jun 18, 2020, 1:12 PM Reply Quote 3
                    • A
                      Alan Kilborn
                      last edited by Jun 18, 2020, 1:06 PM

                      @Ekopalypse

                      Just how does the Pythonscript console do those underlined links?
                      One presumes the console window is just another Scintilla window…

                      It might be nice if in Notepad++ tab windows filenames would appear that way, and provide an easier way for opening files into N++ than the built in open-file-under-caret mechanisms (which aren’t too good).

                      The P.S. console window even nicely handles filepaths with spaces in them; but this is a more “controlled” environment where a tool is handling the path/filename creation, so it may be easier to handle than free-form user text in a N++ tab.

                      E 1 Reply Last reply Jun 18, 2020, 1:11 PM Reply Quote 2
                      • E
                        Ekopalypse @Alan Kilborn
                        last edited by Jun 18, 2020, 1:11 PM

                        @Alan-Kilborn

                        Just how does the Pythonscript console do those underlined links?

                        it does act like a lexer .
                        It waits for the SCN_STYLENEEDED notification and styles the output text accordingly.

                        1 Reply Last reply Reply Quote 2
                        • J
                          jakima @Ekopalypse
                          last edited by Jun 18, 2020, 1:12 PM

                          @Ekopalypse
                          ok i’ll try this. thank you.
                          but… can python script directly interact with the text file to print to console?

                          E 1 Reply Last reply Jun 18, 2020, 1:17 PM Reply Quote 0
                          • E
                            Ekopalypse @jakima
                            last edited by Jun 18, 2020, 1:17 PM

                            @jakima said in Help with generating clickable links or something of that sort:

                            but… can python script directly interact with the text file to print to console?

                            yes, run it through this console.run(r"cmd.exe /c d:\mybatch.bat")
                            it will redirect the output of the cmd window to the console window.

                            J 3 Replies Last reply Jun 18, 2020, 1:19 PM Reply Quote 3
                            • J
                              jakima @Ekopalypse
                              last edited by Jun 18, 2020, 1:19 PM

                              @Ekopalypse
                              ah, ok. again thanks a lot.

                              1 Reply Last reply Reply Quote 0
                              • J
                                jakima @Ekopalypse
                                last edited by Jun 18, 2020, 4:04 PM

                                @Ekopalypse
                                you’re awesome!!!
                                it works as expected.
                                sure, i have to figure out the iterating over notepad part. but yeah, it works!!!
                                i cant thank you enough

                                1 Reply Last reply Reply Quote 2
                                • J
                                  jakima @Ekopalypse
                                  last edited by Jun 18, 2020, 9:08 PM

                                  I figured out the iterating part and found some other things while at it

                                  • the output from the bat has to be on a new line or it wont work

                                  • you dont necessarily need the “, in” part in the second variable ‘b’

                                  E 1 Reply Last reply Jun 19, 2020, 11:01 AM Reply Quote 1
                                  • E
                                    Ekopalypse @jakima
                                    last edited by Jun 19, 2020, 11:01 AM

                                    @jakima

                                    Yes, it must start with <space><space>File<space>" to be identified as an “linkeable” string
                                    and then it reads the rest of that line to see what kind of informations are available.

                                    1 Reply Last reply Reply Quote 2
                                    7 out of 17
                                    • First post
                                      7/17
                                      Last post
                                    The Community of users of the Notepad++ text editor.
                                    Powered by NodeBB | Contributors