Community
    • Login

    Who "broke" my macro??

    Scheduled Pinned Locked Moved General Discussion
    4 Posts 2 Posters 3.0k 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.
    • Jalapeno BobJ
      Jalapeno Bob
      last edited by

      For years now, I have a little macro that allows me to convert an SQL command to a Visual Basic multiline string and it worked beautifully! The keystroke sequence was

      1. Home
      2. Home
      3. "
      4. End
      5. " & vbcrlf & _
      6. Down Arrow

      I would position the cursor at the top and then run to end of file.

      <code>
      If I position my cursor on a line:
      FROM database.dbo.table
      with the current version of Notepad++, instead of getting the expected:
      “FROM database.dbo.table” & vbcrlf & _
      I get
      "“FROM datavase.dbo.table” & vbcrlf & _ [vbcrlf ]
      . [vbClientBasic]
      and the macro STOPS!
      </code>

      How do I turn off this new “feature” and get back my desired behavior??

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Jalapeno Bob
        last edited by

        @Jalapeno-Bob

        don’t know who broke it but did you check shortcuts.xml?
        It has a macro section which should have the steps of your macro.

        If you can’t figure out how to revert the changes, post the macro.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • Jalapeno BobJ
          Jalapeno Bob
          last edited by

          The steps of my macro are in shortcuts.xml:

              <Macro name="SQL quoting for VB" Ctrl="no" Alt="no" Shift="no" Key="0">
                  <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
                  <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam='&quot;' />
                  <Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
                  <Action type="0" message="2451" wParam="0" lParam="0" sParam="" />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam='&quot;' />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam="&amp;" />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam="v" />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam="b" />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam="c" />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam="r" />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam="l" />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam="f" />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam="&amp;" />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
                  <Action type="1" message="2170" wParam="0" lParam="0" sParam="_" />
                  <Action type="0" message="2300" wParam="0" lParam="0" sParam="" />
              </Macro>
          

          It is when I try to use this macro that a little box appears, apparently questioning my action, that stops the repeated execution of the macro. Notepad++ thinks it knows what I want better than I do! How do I turn this off and allow the macro to repeat until the end of file?

          Claudia FrankC 1 Reply Last reply Reply Quote 0
          • Claudia FrankC
            Claudia Frank @Jalapeno Bob
            last edited by

            @Jalapeno-Bob

            the problem happens because of the autocompletion function.
            You either can disable it or change your macro with one additional line
            (should be placed as second to last line

            <Action type="0" message="2325" wParam="0" lParam="0" sParam="" />
            

            which basically means you would press Esc before Arrow down.

            <Macro name="SQL quoting for VB" Ctrl="no" Alt="no" Shift="no" Key="0">
                <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
                <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam='&quot;' />
                <Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
                <Action type="0" message="2451" wParam="0" lParam="0" sParam="" />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam='&quot;' />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam="&amp;" />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam="v" />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam="b" />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam="c" />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam="r" />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam="l" />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam="f" />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam="&amp;" />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
                <Action type="1" message="2170" wParam="0" lParam="0" sParam="_" />
                <Action type="0" message="2325" wParam="0" lParam="0" sParam="" />        
                <Action type="0" message="2300" wParam="0" lParam="0" sParam="" />
            </Macro>
            

            This should do the trick

            Cheers
            Claudia

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