wrapping selected text with html tags via shortcut

wrapping selected text with html tags via shortcut

2
NewbieNewbie
2

    Feb 09, 2005#1

    Hi,
    I am new to UltraEdit and it's macro features. I recently switched from the html editor phase5 which came with a feature to easily wrap selected text with html tags via shortcut. I used that a lot and would like to use it in UE too. E.g. i select a piece of text and then hit alt+enter to wrap it with <p> and </p>.
    I know it works by selecting the tag from the taglist. But i dont want to use my mouse for this.
    Is there a way to do it via macros?

    Thank you

    21
    Basic UserBasic User
    21

      Feb 11, 2005#2

      sure.

      The easiest way to make any macro is to simply manually do the desired edit operation why you have UE in "record" mode. UE will write macro code for every keystroke (and most mouse clicks) you do. When your done. you stop the record.

      you now have working macro code. you can either use it as is or use it as a basis for futher editing. I did such a record.

      I started with some text highlighted and then put UE in record mode.
      I then did a cut, put in the begin tag, pasted and then typed in the end tag. I then stopped the record. I edited the recorded macro and put an if statement around all of it saying on do this if there is a range highlighted.

      Once you have the macro code you can give it a name, and even map it to your desired keyboard shortcut.
      here is that code...

      IfSel
      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      Cut
      "<p>"
      Paste
      "</p>"
      EndIf

      2
      NewbieNewbie
      2

        Feb 12, 2005#3

        Perfect!

        Thank you, that's exactly what I need!