Menu

Macro

2007-12-06
2012-11-13
  • Nobody/Anonymous

    I would like to create / record this macro:
    Find string "XXXX"
    Select from the cursor
    Find string "YYYY"
    Delete the string begining by XXXX, ending by YYYY

    Does anyone know how to do?

    Thanks

     
    • Nobody/Anonymous

      I believe something like this has been asked before on this forum.
      If you look for this you may find something about the Simple Script Plug-In.

       
    • fidvo

      fidvo - 2007-12-06

      The deletebetweentags function in SimpleScript may be what you're looking for.  You could download the beta now or wait until I put the 1.0 version up, hopefully this weekend.  In comparing my source for the 0.9 and the 1.0 version, it looks like the deletebetweentags function wasn't one of the ones I needed to fix, so it should work fine in the beta.

      Let me know if you need any help in using it.

       
      • Nobody/Anonymous

        My understanding of what he was looking for was NOT between lines, but instead, between characters within a line. From his description, he probably needs for the Macro Recording feature to use the FIND dialog. I am also interested in being able to do this. I have seen several notes on this forum about using the FIND with Macro Recording. None indicated success.

         
      • Nobody/Anonymous

        The requester also wants to delete the tags themselves. Is this optional in the function you mention? Or should this be done by additionally deleting the string consisting of both tags?

         
      • fidvo

        fidvo - 2008-01-10

        The deletebetweentags function works on a character basis rather than a line basis.  It was designed for the purpose of stripping out HTML tags.  By using offsets, you can have it include or exclude the text of the tags themselves.

        Unfortunately, it's not working correctly at the moment, so I need to fix it.  I'll have it fixed by the 1.1 version.

         
        • Nobody/Anonymous

          [Are we hyjacking a thread?]

          Perhaps it's a nice idea to include the "include tags" option. This will avoid the need to specify the length of both tags each time, especially when also an additional offset is used.