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

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

Expand Messages
  • John Markley
    ... You are welcome. I love doing this stuff. ... You can run LeadingSpaceDelete by itself to test it if you wish. If you put the first few letters of
    Message 1 of 68 , Nov 9, 2009
    • 0 Attachment
      Quoting Voytek Eymont <voytek@...>:

      > thanks, John.

      You are welcome. I love doing this stuff.

      > I'll test leading space deleter later, I've also kept the original
      > (renamed) SPdelete.

      You can run LeadingSpaceDelete by itself to test it if you wish. If
      you put the first few letters of "LeadingSpaceDelete" in the pScript
      starter dialog it will run without having SPdelete run first.
      *But*, just renaming the first pScript in the SPdelete chain, but not
      all the linked pScripts in the chain ( SPd2, SPd3, etc) will not be
      sufficient, because you will now have *two* SPd6 pScripts, one that
      just ends, {SPd6::d}, and the other that links to LeadingSpaceDelete.
      Again, each pScript in a chain is a complete pScript on its own, and
      it doesn't matter what order they appear. The command
      "/&script$[@@xxx@@]}" says, as the final action of this pScript, go
      find the pScript named xxx and run it. It doesn't matter where in the
      pad the pScript named xxx resides. The code Paul wrote into pedit and
      pToolSet to run pScripts goes to the very start of the pad and scans
      down until it finds {xxx: and runs it. If there is more than one
      pScript with the same name, the one nearest the top of the pad will
      always run, no matter what you intend, because that is the one that
      the program encounters first. You could have the various SPd scripts
      scattered all over the place in your pad, not in numerical order, and
      it would run just fine. The sequential numbering is to assist the
      user logically, not to run the chain. So, if you now have two
      different {SPd6: pScripts, whichever is closer to the top of the pad
      is the one that will run, rgardless of your intent. You must either
      change *all* the names in the chain, or just use "}" to stop SPd6
      after "d". That is to say, in the modified spD6

      {SPd6::d
      /&script$[@@LeadingSpaceDelete@@]}

      if you just put "}" after "d", so it reads

      {SPd6::d }
      /&script$[@@LeadingSpaceDelete@@]}

      then you have the original SPd6, it will stop at "d" and not run /&script$....

      Then you would not need a renamed SPdelete at all.


      > but the set of scripts you made make a pretty good 'web page sanitizer'

      Great!

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