Loading ...
Sorry, an error occurred while loading the content.

Re: [peditors] getting rid of multiple consecutive blanks ?

Expand Messages
  • John Markley
    ... OK, after a little futzing around, there results a pScript which I think will probably do it for you. Considerations - 1) As best I can tell, web text
    Message 1 of 68 , Oct 25, 2009
    • 0 Attachment
      Quoting John Markley <jmmjr@...>:

      > Quoting Paul Nevai <nevai@...-state.edu>:
      >> On Sun, Oct 25, 2009 at 11:40:42PM +1100, Voytek Eymont wrote:
      >
      >>> horizontal spaces, yes, tabs, perhaps
      >>>
      >>> search/regep that Paul suggested clears the above ones
      >>>
      >>> LF and CR, yes

      >> See "visibilator" in pedit's manual, do an visibilator job, then do a REGEXP
      >> search/replace job on the visibilated text, then do an de-visibilator job
      >> again.

      > You guys have solved it before I even awoke! I'm going to
      > experiment with pScripting the visibilator process ala Paul.

      OK, after a little futzing around, there results a pScript which I
      think will probably do it for you.
      Considerations -
      1) As best I can tell, web text capture to pedit results in linefeed
      whitespaces and space whitespaces, but no carriage returns and few if
      any tabs.
      2) You don't need the visibilator and RegExp to get rid of Linefeeds
      with the pedit Find'n'Replace tool.
      3) There is a seemingly insurmountable event-queue block preventing
      the final "Done" event in an AllReplace using pToolSet pSearchTool, so
      I did only a script for pedit. I may fuss more with GlobalMacroMode
      pMacro find-and-replace in PTS, but later.
      4) The following pScript links two chains, the first of which removes
      all LineFeeds, and the second of which uses RegExp to remove all
      multiple spaces. If you run it on a spacey web text memo I expect it
      to clean it up for you nicely. Please let me know. You can start it
      with the cursor anywhere in the memo, it will jump to the top and run.

      {Web Text Cleanup::
      /*delete LF pPro*/
      /xEpro f
      /xEpro T/xEpro W/xEpro R/xEpro r
      /p10
      /&script$[@@WTC2@@]}
      {WTC2::
      /&tap i[080,080]
      /&script$[@@WTC3@@]}
      {WTC3::
      /p32
      /xEpro f A
      /&script$[@@WTC4@@]}
      {WTC4:: d
      /&script$[@@WTC5@@]}
      {WTC5::
      /*delete spaces pPro*/
      /xEpro f
      /xEpro T/xEpro W/xEpro R
      /xs/xs *
      /&script$[@@WTC6@@]}
      {WTC6::
      /&tap i[080,080]
      /&script$[@@WTC7@@]}
      {WTC7::
      /p32
      /xEpro f A
      /&script$[@@WTC8@@]}
      {WTC8:: d}
    • John Markley
      ... OK, now I ve taken it further. One of the disadvantages of the MemoToNote pScript is that it attaches the note to an untimed blank event on todays date
      Message 68 of 68 , Nov 10, 2009
      • 0 Attachment
        Quoting John Markley <jmmjr@...>:

        > Very good. With regard to the "{MemoToNote:" pScript, which evidently
        > is working ok, it ends with your new DateBk memo open, rather than
        > closing the note and showing the entry in Day View by tapping the
        > "Done" button. I did this because there was an exceedingly gnarly
        > problem getting the pScript to do that final "Done" button activation.
        > I have now solved that with a rather cool little trick. If you
        > would prefer to have the pScript end with the DayView entry rather
        > than the open note, replace your pScript with this one-

        OK, now I've taken it further. One of the disadvantages of the
        MemoToNote pScript is that it attaches the note to an untimed blank
        event on todays date and you then need to manually put in the event
        item text (if any) and assign the date and time. The other pScript,
        "pDateMemoNote" would leave you in the pDateTool dialog to select the
        time and date (if you could get pDateTool working - any luck?). Now,
        the new MemoToNote, below, will transfer the memo text to an untimed
        blank event on today's date, as before, but it will end by opening the
        DateBk "Details" dialog, so you can assign time, date, and put in any
        event item text you want.

        {MemoToNote::
        /xc Z
        /xc C
        /0x1C
        /&script$[@@MTN1@@]}
        {MTN1::
        /&launch[@@DateBk6@@]
        /xc N
        /&control[@@No@@]
        /&script$[@@MTN2@@]}
        {MTN2::
        /&script$[@@MTN3@@]}
        {MTN3::
        /xc A
        /xc P
        /&varSet[$1,0]
        /&script$[@@MTN4@@]}
        {MTN4::
        /&varAdd@[$1,1]
        /&control[@@Done@@]
        /&script$[@@MTN5@@]}
        {MTN5::
        /!/$f
        /&ifScript@[$$==1000,@@MTN6@@]
        /&ifAbort@[$1>=10]
        /&ifScript@[$$!=1000,@@MTN4@@]}
        {MTN6::
        /&control[@@Det@@]}

        ~ John
      Your message has been successfully submitted and would be delivered to recipients shortly.