Menu

basic macro help please

2008-07-28
2012-11-13
  • sam sharples

    sam sharples - 2008-07-28

    hi, i am very new to np++ and just need some quick guidelines to start me off please.

    how do i use the macro function? for example:

    -------------------
    #one

    #one:hover

    #two

    #two:hover

    #three

    #three:hover

    -------------------

    and i want to change 'one','two'and 'three' to 'example'

    this is just a basic example. i know u wouldnt do this.

    are there any guides on the net cuz i cant for the life of me find any!

    thanks,sam

     
    • Fool4UAnyway

      Fool4UAnyway - 2008-07-28

      Perhaps you are helped by the information and referenced threads in this thread:

      "Macro Recording & Run Tools" (Help forum)
      http://sourceforge.net/forum/forum.php?thread_id=1984894&forum_id=331754

      You may be best off by using a regular expression to achieve what you want.

      Your regular expression would "say" something like
      - look for each line beginning with # and the word immediately following it
      - replace this by #example

      Move the cursor in the document to the top by pressing Ctrl+Home.

      In the Ctrl+R advanced, or Ctrl+H regular Replace dialog you can enter the following expressions.

      Find field:
      ^#[a-zA-Z]+

      Replace field:
      #example

      Check the regular expression checkbox or click the radio button and replace all occurrences.

      ^________ look for the beginning of a line (so no in-line matches will be found)
      #________ look for the character #
      [a-zA-Z]_ look for any of the characters in the ranges a to z and A to Z
      ......... you may add numbers here as well: add 0-9 after the opening or just before
      ......... the closing square bracket
      +________ look for a consecutive string of matching characters with a minimum of 1

      This doesn't require you to be specific about the lines containing the :hover part.
      But possibly you do not want to replace other #word occurences in the document.