Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    custom button

    Help wanted · · · – – – · · ·
    2
    4
    230
    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.
    • Philippe Lajeu
      Philippe Lajeu last edited by

      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 ?

      Alan Kilborn 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        Alan Kilborn @Philippe Lajeu last edited by

        @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
        • Philippe Lajeu
          Philippe Lajeu last edited by

          and how do you enable that ? :) please

          Alan Kilborn 1 Reply Last reply Reply Quote 0
          • Alan Kilborn
            Alan Kilborn @Philippe Lajeu last edited by

            @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
            • First post
              Last post
            Copyright © 2014 NodeBB Forums | Contributors