• Login
Community
  • Login

Set *.wri as default save extension

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
8 Posts 3 Posters 1.7k 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
    SchwabenGeiz
    last edited by May 22, 2018, 12:12 PM

    Hello everyone,

    I would like to set *.wri as a default save extension.
    Tried to change the langs.xml, but without success.

    BTW, I have created a user-defined language with default extension *.wri, but it is of course not listed in langs.xml. As soon as I manually save the file as XYZ.wri it gets highlighted as specified.

    Thank you in advance!

    C 1 Reply Last reply May 23, 2018, 11:18 AM Reply Quote 1
    • C
      Claudia Frank @SchwabenGeiz
      last edited by May 23, 2018, 11:18 AM

      @schwaben-github

      natively, afaik you can’t - but using a scripting language plugin you could easily
      workaround this, I guess. Simple example for python script

      filename = notepad.prompt('','Save as...','')
      notepad.saveAs(r'C:\{}.wri'.format(filename))
      

      Cheers
      Claudia

      S 1 Reply Last reply May 23, 2018, 1:54 PM Reply Quote 2
      • S
        SchwabenGeiz @Claudia Frank
        last edited by May 23, 2018, 1:54 PM

        Thanks for your help, Claudia!
        But, since I’m inexperienced regarding scripting, could you please detailed describe what you mean by that?
        Which plugin exactly should I use?
        And how should I use the snippet you wrote?

        I know, your answer could be something like “RTFM”, but since I’m tabula rasa… :)

        Thank you in advance!

        C 1 Reply Last reply May 23, 2018, 2:01 PM Reply Quote 1
        • C
          Claudia Frank @SchwabenGeiz
          last edited by May 23, 2018, 2:01 PM

          @schwaben-github

          so here is my quick-rtfm :-D

          • From plugin manager install python script plugin.
          • Once installed goto Plugins->Python Script->NewScript
          • In the save as dialog use a meaningful name for this script
          • paste the content I posted into the newly created document
          • modify the path part as needed and save
          • create a new document with your .wri code and once happy to save goto Plugins->Python Script and select the newly created scipt.

          It will popup an prompt which asks for the filename to be saved

          If this is a way for you - modifications like assigning a shortcut or changing the code
          to your needs can still be done afterwards.

          Cheers
          Claudia

          S S 2 Replies Last reply May 23, 2018, 2:22 PM Reply Quote 2
          • S
            Scott Sumner @Claudia Frank
            last edited by May 23, 2018, 2:22 PM

            @Claudia-Frank

            A huge missed FAQ Desk opportunity…

            :-(

            Of course it is easy for the person that to-date hasn’t authored ANY FAQ Desks himself to throw stones… :-)

            C 1 Reply Last reply May 23, 2018, 2:28 PM Reply Quote 1
            • C
              Claudia Frank @Scott Sumner
              last edited by May 23, 2018, 2:28 PM

              @Scott-Sumner

              to be honest Scott, personally, I don’t think the FAQ should contain plugin related stuff
              but on the other side … hmmm … I agree to write one if you correct my english beforehand. :-D

              So question - should plugin related stuff being FAQ’ed ??

              Cheers
              Claudia

              S 1 Reply Last reply May 23, 2018, 2:33 PM Reply Quote 0
              • S
                Scott Sumner @Claudia Frank
                last edited by May 23, 2018, 2:33 PM

                @Claudia-Frank

                Sure seems like anything that is repeated over and over in this Community is good FAQ Desk material, be it plug-in or whatever…but I have no authority on the final decision. :-)

                But if it is a “go”, then:

                I agree to collaborate with you; email me your FAQ Desk “release candidate” and I will edit and augment.

                These links may help you not reinvent the wheel:

                https://notepad-plus-plus.org/community/topic/10882/feature-request-copy-line-with-number/6
                https://notepad-plus-plus.org/community/topic/14703/run-python-script-pythonscript-plugin-with-a-shortcut
                https://notepad-plus-plus.org/community/topic/12077/opening-read-only-files

                1 Reply Last reply Reply Quote 0
                • S
                  SchwabenGeiz @Claudia Frank
                  last edited by May 23, 2018, 3:28 PM

                  @Claudia-Frank
                  Great, thank you!
                  The post from @scott-sumner helped me to assign shortcut to the script
                  (https://notepad-plus-plus.org/community/topic/14703/run-python-script-pythonscript-plugin-with-a-shortcut )…

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