Macro for ANSI encoding



  • Hello all, I am struggling with this macro - which came out all wrong. I have 200+ text files that I need to import to another software, but it requires the imported to be ANSI. I recorded as follows:
    Ctrl+A
    Ctrl+C
    Convert to ANSI
    Ctrl+V (just in case some characters became crazy)
    Save
    Close
    The macro did not work, and opening the shortcuts.xml file I saw that many commands were not recorded (the ones requiring buttons to be pushed)
    Just for the record, the files are written in Brasilian Portuguese…
    Can anyone please tell me what did I do worng here? Thanks



  • @Nicole-Sigaud

    as you already found out, macro recording sometimes doesn’t record all needed steps.
    If this happens you can use the …\notepad++\localization\english.xml file to find the
    message ids needed and edit shortcuts.xml like this

        <Macro name="Convert to ansi" Ctrl="no" Alt="no" Shift="no" Key="0">
            <Action type="0" message="2013" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2178" wParam="0" lParam="0" sParam="" />
            <Action type="2" message="0" wParam="45009" lParam="0" sParam=""/>
            <Action type="0" message="2179" wParam="0" lParam="0" sParam="" />
        </Macro>
    

    The message 45009 is doing the conversion, the others were recorded.

    Cheers
    Claudia



  • Thanks a lot, I’m trying this out.



  • Claudia, isn’t it possible to save and close? I still have doubts about the difference between the Action types - is it that type=“2” refers solely to wParam number listed on items id from “english.xml” file?



  • @Nicole-Sigaud

    if you edit shorcuts.xml you need to restart npp to make it happen.
    In regards to the different action types you might want to take a look
    here
    .

    Cheers
    Claudia


Log in to reply