Who "broke" my macro??



  • 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??



  • @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



  • 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?



  • @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


Log in to reply