Community
    • Login

    custom button

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 1.1k Views 1 Watching
    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 LajeuP Offline
      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 KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        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 LajeuP Offline
          Philippe Lajeu
          last edited by

          and how do you enable that ? :) please

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • Alan KilbornA Offline
            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

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors