• Login
Community
  • Login

custom button

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 2 Posters 721 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.
  • P
    Philippe Lajeu
    last edited by Jun 9, 2021, 12:11 AM

    Hello there, i’d like to know how i can create a cumtomized button to have a prewritten template already present on the page.

    On practice it would be a call come in, i click this button and Pouf a new page with a perwritten templace appear. instead of always copy pasting from another text. Is that possible ?

    A 1 Reply Last reply Jun 9, 2021, 12:42 AM Reply Quote 0
    • A
      Alan Kilborn @Philippe Lajeu
      last edited by Jun 9, 2021, 12:42 AM

      @Philippe-Lajeu

      With a scripting plugin it is fairly simple to do.
      Here’s an example with PythonScript:

      # -*- coding: utf-8 -*-
      
      from Npp import editor, notepad
      
      template_text ='''I am a template
      
      of whatever you want; as
      
      many lines as you want; or
      
      
      whatever
      '''
      
      notepad.new()
      editor.setText(template_text)
      

      Result when you run it:

      ce712209-bae4-4c82-8383-455d67dee981-image.png

      i click this button and Pouf a new page…

      You can tie the running of a script to a toolbar button

      1 Reply Last reply Reply Quote 2
      • P
        Philippe Lajeu
        last edited by Jun 9, 2021, 2:52 PM

        and how do you enable that ? :) please

        A 1 Reply Last reply Jun 9, 2021, 2:54 PM Reply Quote 0
        • A
          Alan Kilborn @Philippe Lajeu
          last edited by Jun 9, 2021, 2:54 PM

          @Philippe-Lajeu said in custom button:

          and how do you enable that ? :) please

          A good into to setting up a script is found HERE.

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