Set *.wri as default save extension
-
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!
-
@schwaben-github
natively, afaik you can’t - but using a scripting language plugin you could easily
workaround this, I guess. Simple example for python scriptfilename = notepad.prompt('','Save as...','') notepad.saveAs(r'C:\{}.wri'.format(filename))Cheers
Claudia -
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!
-
@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 -
A huge missed
FAQ Deskopportunity…:-(
Of course it is easy for the person that to-date hasn’t authored ANY
FAQ Desks himself to throw stones… :-) -
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. :-DSo question - should plugin related stuff being FAQ’ed ??
Cheers
Claudia -
Sure seems like anything that is repeated over and over in this Community is good
FAQ Deskmaterial, 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 -
@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)…
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