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

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

Expand Messages
  • John Markley
    ... OK, the problem, which I still don t fully understand, resides in having the two processes linked, *and* running them using the pedit Script Memo ESC &
    Message 1 of 68 , Oct 25, 2009
    • 0 Attachment
      Quoting John Markley <jmmjr@...>:

      >
      > Stop, hold off. There is some problem with the Web Text Cleaner
      > pScript I posted earlier that I don't fully understand yet. Do not
      > use it.

      OK, the problem, which I still don't fully understand, resides in
      having the two processes linked, *and* running them using the pedit
      "Script Memo" ESC & command, plus a conflict I had in my own setup.
      But they work fine separately, so here is what you can do.

      There are a bunch of ways to run pScripts with pToolSet, but I'm
      assuming that you are running only peditPro. So, do the following-

      1) Put the two pScripts below in your pScriptPad (the pad carries the
      label #1, but in fact it is the only pScriptPad). If you are able it
      is best to copy from this email and paste into your pScriptPad rather
      than manually transcribing, to avoid errors.

      2) Open a spacey web page text in pedit.

      3) Open menu, select R1, select "Script Memo" (or just do "ESC &").

      4) Type "LFd" (without the "") into the dialog box, then type ":"
      (without the "") or tap the D:, and the pScript will run. (this
      assumes you have no other pScripts whose identifier name starts with
      "LFd".

      The pScript opens the pedit find'n'replace (ESC f), sets it to
      start at the top, wrap, and unchecks RegExp, puts a LineFeed in the
      find field, and puts a single space in the replace field and then hits
      the Find/Repl button, then AllR, then Done. This will remove all
      linefeeds.

      5) Open menu, select R1, select "Script Memo" again.

      6) Type "SPd" (without the "") into the dialog box, then type ":"
      (without the "") or tap the D:, and the pScript will run. (this
      assumes you have no other pScripts whose identifier name starts with
      "SPd".

      The opens find'n'replace, checks RegExp on, puts " *" in the find
      field and a single space " " (/xs/xs*) in the replace field, and runs
      the All Replace. This will replace all multiple spaces with single
      spaces.
      The final result after both pScripts should be a clean, compact,
      non-spacey text.

      If you don't want to use the pScripts you can of course do these f&r's
      manually.

      Make sure beforehand that you do not have the * character selected as
      your pedit ESC character as that would confuse the RegExp
      implementation of " *".



      {LFdelete::
      /&runtimeInit[]
      /xEpro f
      /xEpro T/xEpro W/xEpro R/xEpro r
      /p10
      /&script$[@@LFd2@@]}
      {LFd2::
      /&tap i[080,080]
      /&script$[@@LFd3@@]}
      {LFd3::
      /p32
      /xEpro f A
      /&script$[@@LFd4@@]}
      {WTC4:: d}


      {SPdelete::
      /&runtimeInit[]
      /xEpro f
      /xEpro T/xEpro W/xEpro R
      /xs/xs *
      /&script$[@@SPd2@@]}
      {SPd2::
      /&tap i[080,080]
      /&script$[@@SPd3@@]}
      {SPd3::
      /p32
      /xEpro f A
      /&script$[@@SPd4@@]}
      {SPd4:: d}


      Eventually I'll figure out how to link these together to run as one
      without the problems I was seeing, but not tonight.

      Addendum - just received your recent post. See how these two do. If
      we have to change to deal with tabs we will.

      ~ John
    • 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.