Menu

Scintilla in Macros?

2008-05-29
2012-11-13
  • Bob Helling

    Bob Helling - 2008-05-29

    How do I execute Scintilla commands in a macro if they are not associated with a key combination?

    Is there a way to execute Scintilla commands directly without the key association?
    Thanks,
    Bob

     
    • Bob Helling

      Bob Helling - 2008-06-02

      Thanks Greg!

      This is definitely more complicated than I had hoped.  I will probably end up attaching the Scintilla command to a key combination after all.  But I do appreciate you explaining it so well and I may try it just as an experiment.
      Bob

       
    • Greg Bullock

      Greg Bullock - 2008-05-31

      Bob,

      You'd need to edit the macro directly in the file %AppData%\Notepad++\shortcuts.xml. There's no easy user interface, of course, so you need to consult the source code for the Scintilla message codes any details about codes and meanings.  You'll probably want to first record a stub macro with a few dummy commands so you'll have something to start editing. Here's an overview to get you started.

      For each macro step,

      (1) the first parameter is an integer indicating the type of step: 
      0 = Windows WM_NOTIFY message, using an integer LPARAM,
      1 = Windows WM_NOTIFY message, using a string parameter,
      2 = Windows WM_COMMAND message (i.e., a menu command).

      Macro steps with a Scintilla message will be of type 0 or 1, not of type 2.

      (2) the second parameter is an integer indicating the message id. Typically, this is a Scintilla message, one of the SCI_XXX constants in the file scintilla\include\Scintilla.h

      (3) the third parameter is an integer giving either
      (a) the WPARAM parameter, for type 0 or type 1 macro steps, or
      (b) the menu command id, for type 3 macro steps -- these ids are defined in the file PowerEditor\src\resource.h

      (4) the fourth parameter is an integer giving the LPARAM parameter, for type 0 macro steps,

      (5) the fifth parameter is the value of the string constant for type 1 macro steps.

      Regards.
      Greg