• Login
Community
  • Login

About editing .sol files

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 3 Posters 3.4k 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.
  • K
    kissofkill
    last edited by kissofkill Oct 16, 2020, 11:07 PM Oct 16, 2020, 11:06 PM

    Hello everyone,

    I got a basic question. I can’t find anything on the web for being able to edit .sol files with Notepad++. Anyone got a plugin for it?**

    Basically;
    Whenever I open a sol file it looks like this:

    1

    However it should look like this instead;

    2

    Any help is appreciated, thank you so much

    P 1 Reply Last reply Oct 16, 2020, 11:22 PM Reply Quote 0
    • P
      PeterJones @kissofkill
      last edited by PeterJones Oct 16, 2020, 11:22 PM Oct 16, 2020, 11:22 PM

      @kissofkill ,

      Based on your screenshot, .sol files are binary files that happen to have text in them. Notepad++ is a text editor; if the files are not completely text, Notepad++ is not really the right application. This FAQ explains more.

      In theory, someone could write a plugin that would do the conversion to text during file load, and do the conversion ot binary during file save. However, that would require that there is someone who 1) understands the .sol format, and 2) cares enough about Notepad++ and .sol to want a plugin, and 3) has the necessary skillset. Your chances of finding someone who meets all three criteria are rather slim, even in the Notepad++ forum.

      Alternately, if there is already a .sol <=> text converter, you could set up a script using the NppExec plugin that could convert those, or using the PythonScript or similar that would hook into the file-open and file-save events to automatically run that converter. If you know of such a converter, then the pair of NppExec scripts below could be quickly modified to run that converter (right now, the gpg.exe ... lines are “placeholders” for whatever converter you use)

      decrypt (this would be used for converting from .sol to text)

      cls
      npp_save
      cmd.exe /c exit %RANDOM%														// cannot access $(SYS.RANDOM) directly through NppExec, but can tell cmd.exe to return it as a value
      set tempfile = $(SYS.TEMP)\NppGpgFile_$(EXITCODE).tmp							// create random tempfile name
      set ascfile = $(SYS.TEMP)\NppGpgFile_$(EXITCODE).asc							// create associated ascfile name
      sci_sendmsg SCI_SELECTALL														// select all
      sel_saveto $(ascfile) :a														// save selection to the ascfile	(use :a to save as ansi, to prevent unicode prefix ÿþ getting embedded)
      gpg.exe --output "$(tempfile)" --decrypt "$(ascfile)"							// decrypt
      sel_loadfrom $(tempfile)														// replace selection with results
      sci_sendmsg SCI_DOCUMENTSTART													// deselect
      rm -rf "$(tempfile)" "$(ascfile)"												// cleanup temp files
      npp_save
      

      encrypt (this would be used for converting back to binary before saving):

      cls
      npp_save
      cmd.exe /c exit %RANDOM%														// cannot access $(SYS.RANDOM) directly through NppExec, but can tell cmd.exe to return it as a value
      set tempfile = $(SYS.TEMP)\NppGpgFile_$(EXITCODE).tmp							// create random tempfile name
      set ascfile = $(SYS.TEMP)\NppGpgFile_$(EXITCODE).asc							// create associated ascfile name
      sci_sendmsg SCI_SELECTALL														// select all
      sel_saveto $(tempfile) :a														// save selection to the tempfile	(use :a to save as ansi, to prevent unicode prefix ÿþ getting embedded)
      INPUTBOX "Recipients (use -r between multiple): " : peter.jones@maximintegrated.com -r petercj@pryrt.com	// get the recipients
      gpg.exe --output "$(ascfile)" -ase -r $(INPUT) "$(tempfile)"					// armor+sign+encrypt to recipient(s)
      sel_loadfrom $(ascfile)															// replace selection with results
      sci_sendmsg SCI_DOCUMENTSTART													// deselect
      //rm -rf "$(tempfile)" "$(ascfile)"												// cleanup temp files
      npp_save
      

      Save these in the NppExec Run interface, and use NppExec to add them to the macro menu, and you could even assign keyboard shortcuts.

      (Hmm, I’ve never used it, but maybe the example Pork2Sausage plugin could be configured to run that external converter… I think that’s what it does, after all…)

      Doing it in PythonScript would be more work for me, since I don’t already have boilerplate for that, but if you absolutely had to have the conversion automatic from file open and file save commands, it could be done (and someone here might be willing to show a framework for how to do that)

      1 Reply Last reply Reply Quote 2
      • K
        kissofkill
        last edited by Oct 17, 2020, 12:27 AM

        Thank you so much for your detailed reply. I will try this method. I just hoped maybe someone had a plugin for it but I guess ,as you said, chances are really slim.

        1 Reply Last reply Reply Quote 0
        • A
          andrecool-68
          last edited by Oct 18, 2020, 10:42 AM

          @kissofkill
          This is a configuration file Adobe Flash!
          What does Notepad ++ have to do with it?

          1 Reply Last reply Reply Quote 1
          • K
            kissofkill
            last edited by Oct 18, 2020, 11:43 AM

            @andrecool-68 I thought maybe there was a plugin for it, I thought it was a basic text file.

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