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

Possible useful text-editing pScript

Expand Messages
  • John Markley
    Greetings and best wishes for 2008 to all. For quite some time I have been irritated by the occasional mangling of a string of text by unplanned mishaps
    Message 1 of 13 , Jan 1, 2008
    • 0 Attachment
      Greetings and best wishes for 2008 to all. For quite some time I have been irritated by
      the occasional mangling of a string of text by unplanned mishaps whilst said string is in
      the highlighted state preparatory to some manipulation. A lowlight event you might say.
      Contemplating oncoming life without (much) stylus has put further focus on this. Paul has
      put a very nice feature in peditPro, using the "Set Marker" (ESC @) command plus the
      "Marker" button in the pedit symmetric selector, which allows to select any arbitrary string
      of text without running a stylus over it. But this feature is limited to pedit and is not
      avaiable in pEditTool Select, which is limited to prescribed chunks of text e.g. current
      lines, current words, etc. As far as I know there are no apps for Palm OS which will select
      arbitrarily delimited text strings, although there are some others which will select similarly
      to pEditTool Select. So I've made one with a pair of pScripts. It (they) has the additional
      advantage that the text is never actually highlighted and consequently cannot be deranged
      in process.
      The pScript pair is presented below in hopes some of you may find it useful. You put the
      cursor at the start of the text you wish to copy, and activate {COPY START. A gratifying
      message will be seen denoting success. :)
      You then put the cursor at the end of the string to be copied and activate {COPY FINISH,
      another message results, and the string now resides in the clipboard to be pasted
      wherever desired. If either is activated in any circumstance other than a text field with an
      active cursor, nothing whatever will happen.


      {COPY START::
      /&ifAbort@[$^==0]
      /!/$c/&varSet@[$4,$$]
      /&mess [@@MARKED@@,,040]}


      {COPY FINISH::
      /&ifAbort@[$^==0]
      /!/$c
      /&varSet@[$5,$$]
      /&varAdd@[$5,-$4]
      /&varSubStr@[$B,$^,$4,$5]
      /&clipAdd i[$B]
      /&mess [@@COPIED@@,,040]}

      cheers, John
    • fjmancho
      Hi John, ... useful. Very good idea. I am using it. I have incorportated it to my six clip magicPad script. Jose F. Jose Mancho mobil number +254726 939095
      Message 2 of 13 , Jan 2, 2008
      • 0 Attachment
        Hi John,

        <jmmjr@...> wrote:
        >The pScript pair is presented below in hopes some of you may find it
        useful.

        Very good idea. I am using it. I have incorportated it to my six clip
        magicPad script.


        Jose


        F. Jose Mancho
        mobil number +254726 939095
      • John Markley
        ... Oh good. I was hoping it would prove useful to someone other than me. Hope you are ok in Nairobi! ~ John
        Message 3 of 13 , Jan 2, 2008
        • 0 Attachment
          Quoting fjmancho <fjmancho@...>:

          >
          > Hi John,
          >
          > <jmmjr@...> wrote:
          >> The pScript pair is presented below in hopes some of you may find it
          > useful.
          >
          > Very good idea. I am using it. I have incorportated it to my six clip
          > magicPad script.
          >
          >
          > Jose

          Oh good. I was hoping it would prove useful to someone other than me.
          Hope you are ok in Nairobi!

          ~ John
        • fjmancho
          Hi John, ...... Original Message ....... ... Thanks John. Thinks are fine, just now. Though today might be the begining of a tough time. Pray for Kenya Jose F.
          Message 4 of 13 , Jan 2, 2008
          • 0 Attachment
            Hi John,



            ...... Original Message .......
            On Wed, 02 Jan 2008 14:02:43 -0500 John Markley <jmmjr@...> wrote:
            >Hope you are ok in Nairobi!
            >

            Thanks John. Thinks are fine, just now. Though today might be the begining
            of a tough time.
            Pray for Kenya

            Jose


            F. Jose Mancho
            mobil number +254726 939095
          • bluefish1960
            ... Hi Jose. You have my interest with this six clip magipad script! Would you care to share it, as I ran a search and did not come up with a reference to it.
            Message 5 of 13 , Jan 3, 2008
            • 0 Attachment
              --- In peditors@yahoogroups.com, fjmancho <fjmancho@...> wrote:
              >

              Hi Jose.
              You have my interest with this six clip magipad script! Would you care
              to share it, as I ran a search and did not come up with a reference to it.

              Regards
              Andy
              > Hi John,
              >
              > <jmmjr@...> wrote:
              > >The pScript pair is presented below in hopes some of you may find it
              > useful.
              >
              > Very good idea. I am using it. I have incorportated it to my six clip
              > magicPad script.
              >
              >
              > Jose
              >
              >
              > F. Jose Mancho
              > mobil number +254726 939095
              >
            • fjmancho
              Hi Andy, This is the nini . I have reserved the last six magipad as temporary (rotating) clipboards. The six clips magipad script is actually three
              Message 6 of 13 , Jan 3, 2008
              • 0 Attachment
                Hi Andy,

                This is the "nini".
                I have reserved the last six magipad as temporary (rotating) clipboards.

                The "six clips magipad script" is actually three pScripts.

                a. The first one controls which magipad was last used and pastes the actual highlighted text in the next one.

                b. The second script shows you consecutively the six clipboards.
                I have renamed the last six magipads as follows: clip1, clip2, .... so that it is easier to identify them.
                A secondary script (wait1) controls the speed of the clip sequence (100 is the value that fits my T3 and my eyes)

                c. The third one is actually six scripts; They are meant to paste each of the six clips.




                a)
                {clip0:: /Kq /K2cA
                /&script$ [@@clip01@@]}
                {clip01::/&ifGoTo@ [$9<6,@@X@@]
                /&varSet@[$9,0]
                /:X
                /&varAdd@[$9,1]
                /&ifScript@ [$9==1,@@clip1@@]
                /&ifScript@ [$9==2,@@clip2@@]
                /&ifScript@ [$9==3,@@clip3@@]
                /&ifScript@ [$9==4,@@clip4@@]
                /&ifScript@ [$9==5,@@clip5@@]
                /&ifScript@ [$9==6,@@clip6@@]}

                {clip1::/&specAct[200] /xEpet s8. /&script [@@clipSv@@]}
                {clip2:: /&specAct[201] /xEpet s8. /&script [@@clipSv@@]}
                {clip3::/&specAct[202] /xEpet s8. /&script [@@clipSv@@]}
                {clip4::/&specAct[203] /xEpet s8. /&script [@@clipSv@@]}
                {clip5::/&specAct[204] /xEpet s8. /&script [@@clipSv@@]}
                {clip6::/&specAct[205] /xEpet s8. /&script [@@clipSv@@]}
                {clipSv:: /K4cA /!/KP/xEpeto}


                b)
                {ShwClp0::/&specAct[200] /&script [@@wait1@@]/o
                /&script$ [@@ShwClp1@@]}
                {ShwClp1::/&specAct[201]/&script [@@wait1@@]/o
                /&script$ [@@ShwClp2@@]}
                {ShwClp2::/&specAct[202]/&script [@@wait1@@]/o
                /&script$ [@@ShwClp3@@]}
                {ShwClp3::/&specAct[203]/&script [@@wait1@@]/o
                /&script$ [@@ShwClp4@@]}
                {ShwClp4::/&specAct[204]/&script [@@wait1@@]/o
                /&script$ [@@ShwClp5@@]}
                {ShwClp5::/&specAct[205]/&script [@@wait1@@]/o}

                {wait1::
                /&varSet@[$1,0] /:X /&varAdd@[$1,1] /&ifGoTo@[$1<100,@@X@@]}

                c)
                {pst1::/&specAct[200] /xEpet s8. /xEpet q}
                {pst2::/&specAct[201] /xEpet s8. /xEpet q}
                {pst3::/&specAct[202] /xEpet s8. /xEpet q}
                {pst4::/&specAct[203] /xEpet s8. /xEpet q}
                {pst5::/&specAct[204] /xEpet s8. /xEpet q}
                {pst6::/&specAct[205] /xEpet s8. /xEpet q}



                I call the frist pScript with a customized pScritpButton.
                e.g
                custBtn.001.9
                {6 clipboards 6::ALIAS::clip0}

                I prefer to call the second and the six third pScripts with the palm ShortCuts (It is easy as you are writting)
                e.g.
                [ShortCut]sc, [ShortCut]p1, [ShortCut]p2 and so...

                For doing so you must:

                a) Add a High ASCII character at the end of your pScriptName
                e.g
                {pst1¤::/&specAct[200] /xEpet s8. /xEpet q}

                or operate with an alias
                e.g.
                {¤::ALIAS::pst1}



                b) define for these Shortcuts in the palm preferences

                e.g.
                ShortCut name
                p1
                ShortCut text
                [ESC]¤
                ([ESC] stands for your pMaster ESC character)


                THAT IS IT


                PS1: Known problems (maybe someone can help):
                At least I know one. After a soft reset $9 becames an undefined variable and you get a message telling you so.

                PS2: I have incorporated John M's idea in this way

                {COPYS::
                /&ifAbort@[$^==0]
                /!/$c/&varSet@[$4,$$]
                /&mess [@@MARKED@@,,040]}

                {COPYF::
                /&ifAbort@[$^==0]
                /!/$c
                /&varSet@[$5,$$]
                /&varAdd@[$5,-$4]
                /&varSubStr@[$A,$^,$4,$5]
                /&script$[@@clip01@@]}


                *Note that the variable is now $A.





                Regards,

                Jose



                F. Jose Mancho
                mobil number +254726 939095
              • John Markley
                ... Excellent!! ... Can t think of a way around this without a *very* ponderous and cludgy maneuver. ... Yup, nice. ~ John
                Message 7 of 13 , Jan 3, 2008
                • 0 Attachment
                  Quoting fjmancho <fjmancho@...>:

                  > Hi Andy,
                  >
                  > This is the "nini".
                  > I have reserved the last six magipad as temporary (rotating) clipboards.
                  >
                  > The "six clips magipad script" is actually three pScripts.
                  >
                  > a. The first one controls which magipad was last used and pastes the
                  > actual highlighted text in the next one.
                  >
                  > b. The second script shows you consecutively the six clipboards.
                  > I have renamed the last six magipads as follows: clip1, clip2, ....
                  > so that it is easier to identify them.
                  > A secondary script (wait1) controls the speed of the clip sequence
                  > (100 is the value that fits my T3 and my eyes)
                  >
                  > c. The third one is actually six scripts; They are meant to paste
                  > each of the six clips.
                  >

                  Excellent!!
                  >

                  >
                  > PS1: Known problems (maybe someone can help):
                  > At least I know one. After a soft reset $9 becames an undefined
                  > variable and you get a message telling you so.
                  >

                  Can't think of a way around this without a *very* ponderous and
                  cludgy maneuver.

                  > PS2: I have incorporated John M's idea in this way

                  > /&script$[@@clip01@@]}

                  Yup, nice.

                  ~ John
                • John Markley
                  ... If you are willing to dedicate one more magipad to this, and a little more run time to {clip0:, you could keep a record of the most recent past magipad
                  Message 8 of 13 , Jan 4, 2008
                  • 0 Attachment
                    Quoting fjmancho <fjmancho@...>:

                    > PS1: Known problems (maybe someone can help):
                    > At least I know one. After a soft reset $9 becames an undefined
                    > variable and you get a message telling you so.
                    >

                    If you are willing to dedicate one more magipad to this, and a
                    little more run time to {clip0:, you could keep a record of the most
                    recent past magipad clip used, which does survive a soft rest, so as to
                    know where to reset $9, by the following addition to the {clip0: chain
                    --


                    {clip0::/Kq /K2cA
                    /&script$[@@clip0a@@]}
                    {clip0a::
                    /&specAct[199]
                    /xEpet s8
                    /0x08
                    /&varPrint@[$9]
                    /xEpet o
                    /&script$[@@clip01@@]}

                    ~ John
                  • fjmancho
                    ... I don t personally mind losing track, once in a while, of the most recent clip used. Neither I dislike the message $1 var is undifined . The problem is
                    Message 9 of 13 , Jan 4, 2008
                    • 0 Attachment
                      John Markley wrote:
                      >you could keep a record of the most
                      >recent past magipad clip used,

                      I don't personally mind losing track, once in a while, of the most recent
                      clip used. Neither I dislike the message "$1 var is undifined". The problem
                      is the subsequent pasting in magipad of the string
                      ifGoTo@ [$9<6,@@X@@].

                      Usually not even this issue is relevant because the process of the pscript
                      continues. It becomes relevant when in your pasting a "big" text is to be
                      deleted. Then the process stops at the alert point "this editing operation
                      cannot be undone".

                      I don't know how to make it silent.

                      "/!/KP" does the normal job silently either you delete a big or small
                      previos text but "/&ifGoTo@ [$9<6,@@X@@]" doesn't seem to be affectes by
                      /! .

                      I have tried to operate with the theoretical value of $1 at that point
                      (-2147483648) using ifGoTos staments but it doesn't work.

                      Any idea?

                      Regards,

                      Jose



                      PS: pray for Kenya
                    • John Markley
                      ... Yup. I haven t tried this in your 6 pad clip, as I ve not put your whole set of chains into my pScriptPad, but it works well for me under similar
                      Message 10 of 13 , Jan 5, 2008
                      • 0 Attachment
                        Quoting fjmancho <fjmancho@...>:

                        > The problem
                        > is the subsequent pasting in magipad of the string
                        > ifGoTo@ [$9<6,@@X@@].
                        >
                        > Usually not even this issue is relevant because the process of the pscript
                        > continues. It becomes relevant when in your pasting a "big" text is to be
                        > deleted. Then the process stops at the alert point "this editing operation
                        > cannot be undone".
                        > I don't know how to make it silent.
                        > "/!/KP" does the normal job silently either you delete a big or small
                        > previos text but "/&ifGoTo@ [$9<6,@@X@@]" doesn't seem to be affectes by
                        > /! .
                        > I have tried to operate with the theoretical value of $1 at that point
                        > (-2147483648) using ifGoTos staments but it doesn't work.
                        >
                        > Any idea?

                        Yup. I haven't tried this in your 6 pad clip, as I've not put your
                        whole set of chains into my pScriptPad, but it works well for me under
                        similar circumstances in a couple of multi-chain pScripts I use daily.
                        You would insert a pScript in the chain, at the point where the "this
                        editing operation cannot be undone" dialog appears, which detects the
                        form id number at that point. If it is form number 12000, which is the
                        id for the "this editing operation cannot be undone" form in magipad it
                        activates the "OK" button to clear the large text. If it is not form
                        12000 it keeps going as normal. (BTW, you can find the form number for
                        any screen by running this ((with your choice of $i, I used $2 here))-

                        {Form ID#::
                        /!/$f
                        /&varSet@[$2,$$]
                        /&varShow@[$2]}

                        The string of tokens and expressions to clear the large text is

                        {DELETE::
                        /!/$f
                        /&varSet@[$2,$$]
                        /&ifScript@[$2==12000, @@DELETE2@@]
                        /&script$[@@xxxx@@]}
                        {DELETE2::
                        /&control[@@OK@@]}


                        I'm not sure, you'll need to experiment, but it looks to me like you'd
                        insert this in {clipSv: after the /KP, either as a new pScript in the
                        chain, or as a continuation of {clipSv:, thus -

                        {clipSv:: /K4cA /!/KP
                        /!/$f
                        /&varSet@[$2,$$]
                        /&ifScript@[$2==12000, @@DELETE2@@]
                        /&script$[@@xxxx@@]}
                        {DELETE2::
                        /&control[@@OK@@]}

                        and the pScript I've dummied in as "xxxx" would start with

                        "/xEpeto".

                        This may not be quite right, but I'll bet you can make it work with
                        a little experimentation.....

                        ~ John
                      • fjmancho
                        Hi John, thank you again. It works! ... I have inserted your pScript in clip01 after /&ifGoTo@ [$9
                        Message 11 of 13 , Jan 5, 2008
                        • 0 Attachment
                          Hi John,
                          thank you again. It works!

                          >Yup. I haven't tried this in your 6 pad clip, as I've not put your
                          >whole set of chains into my pScriptPad, but it works well for me under
                          >similar circumstances in a couple of multi-chain pScripts I use daily.

                          >You would insert a pScript in the chain, at the point where the "this
                          >editing operation cannot be undone" dialog appears,




                          I have inserted your pScript in clip01 after
                          /&ifGoTo@ [$9<6,@@X@@]

                          I still lose track of the clip sequence after a soft reset (which I don't
                          mind) but the problem is basicaly solved.

                          The pScript now looks like this:

                          {clip0:: /Kq /K2cA /&script$ [@@clip01@@]}
                          {clip01::/&ifGoTo@ [$9<6,@@X@@]
                          /!/$f
                          /&varSet@[$2,$$]
                          /&ifScript@[$2==12000, @@DELETE2@@]
                          /&varSet@[$9,0]
                          /:X
                          /&varAdd@[$9,1]
                          /&ifScript@ [$9==1,@@clip1@@]
                          /&ifScript@ [$9==2,@@clip2@@]
                          /&ifScript@ [$9==3,@@clip3@@]
                          /&ifScript@ [$9==4,@@clip4@@]
                          /&ifScript@ [$9==5,@@clip5@@]
                          /&ifScript@ [$9==6,@@clip6@@]}

                          {clip1::/&specAct[200] /xEpet s8. /&script [@@clipSv@@]}
                          {clip2:: /&specAct[201] /xEpet s8. /&script [@@clipSv@@]}
                          {clip3::/&specAct[202] /xEpet s8. /&script [@@clipSv@@]}
                          {clip4::/&specAct[203] /xEpet s8. /&script [@@clipSv@@]}
                          {clip5::/&specAct[204] /xEpet s8. /&script [@@clipSv@@]}
                          {clip6::/&specAct[205] /xEpet s8. /&script [@@clipSv@@]}
                          {clipSv:: /K4cA /!/KP/xEpeto}

                          {DELETE2::
                          /&control[@@OK@@]}


                          Regards,

                          Jose




                          F. Jose Mancho
                          mobil number +254726 939095
                        • John Markley
                          ... Ah, very good. You are welcome. ~ John
                          Message 12 of 13 , Jan 5, 2008
                          • 0 Attachment
                            Quoting fjmancho <fjmancho@...>:

                            > Hi John,
                            > thank you again. It works!

                            Ah, very good. You are welcome.
                            ~ John
                          • fjmancho
                            Hi I would like to add some corrections to the 6 clips-pScript in other to skip the bug after soft reset. Just in case some one is interested Runing the
                            Message 13 of 13 , Jan 10, 2008
                            • 0 Attachment
                              Hi

                              I would like to add some corrections to the 6 clips-pScript in other
                              to skip the bug after soft reset. Just in case some one is interested

                              Runing the pScript after a soft reset has two consequences caused by
                              /&ifGoTo@ [$9<6,@@X@@]:
                              a) a message ("$9 undefined") is displayed (it has little practical
                              importance)
                              b) the command "ifGoTo@ [$9<6,@@X@@]" is printed.

                              The point in which this command is printed could be a problem. In my
                              T3, it coincides at the point in which magipad 200 is open and all its
                              content selected (/xEpet s8.). If the text is big enough the message
                              "This editing operation cannot be undone" comes up.

                              John M. suggested adding some commands that seemed to work when added
                              after /&ifGoTo@ [$9<6,@@X@@]. I have come to know that the effect of
                              those commands more than anything was to alter the chain of events in
                              the palm so that the pasting of /&ifGoTo@ [$9<6,@@X@@] was taking
                              place before the selection of the whole text in magipad 200 (that is
                              before /xEpet s8. is performed) and so the message "This editing..."
                              avoided.

                              Note that printing at the end of magipad 200, at this point, is not a
                              problem as this text is going to be deleted.


                              I have added two empty lilnks at "{clip1::", between /&specAct[200]
                              and /xEpet s8., and the problem is equally (and more logically) solved.

                              Note that the number of empty links could vary among different palm tops.


                              The the pScript is now as follows:

                              a) copy
                              {clip0:: /Kq /K2cA /&script$ [@@clip01@@]}
                              {clip01:: /&ifGoTo@ [$9<6,@@X@@]
                              /&varSet@[$9,0]
                              /:X
                              /&varAdd@[$9,1]
                              /&ifScript@ [$9==1,@@clip1@@]
                              /&ifScript@ [$9==2,@@clip2@@]
                              /&ifScript@ [$9==3,@@clip3@@]
                              /&ifScript@ [$9==4,@@clip4@@]
                              /&ifScript@ [$9==5,@@clip5@@]
                              /&ifScript@ [$9==6,@@clip6@@]}

                              {clip1::/&specAct[200] /&script [@@clip10@@]}
                              {clip10::/&script [@@clip11@@]}
                              {clip11::/&script [@@clip12@@]}
                              {clip12::/xEpet s8. /&script [@@clipSv@@]}
                              {clip2:: /&specAct[201] /xEpet s8. /&script [@@clipSv@@]}
                              {clip3::/&specAct[202] /xEpet s8. /&script [@@clipSv@@]}
                              {clip4::/&specAct[203] /xEpet s8. /&script [@@clipSv@@]}
                              {clip5::/&specAct[204] /xEpet s8. /&script [@@clipSv@@]}
                              {clip6::/&specAct[205] /xEpet s8. /&script [@@clipSv@@]}
                              {clipSv:: /K4cA /!/KP/xEpeto}

                              b) paste
                              {pst1::/&specAct[200] /xEpet s8. /xEpet q}
                              {pst2::/&specAct[201] /xEpet s8. /xEpet q}
                              {pst3::/&specAct[202] /xEpet s8. /xEpet q}
                              {pst4::/&specAct[203] /xEpet s8. /xEpet q}
                              {pst5::/&specAct[204] /xEpet s8. /xEpet q}
                              {pst6::/&specAct[205] /xEpet s8. /xEpet q}


                              c) John M's copy method
                              {COPYS::
                              /&ifAbort@[$^==0]
                              /!/$c/&varSet@[$4,$$]
                              /&mess [@@MARKED@@,,040]}

                              {COPYF::
                              /&ifAbort@[$^==0]
                              /!/$c
                              /&varSet@[$5,$$]
                              /&varAdd@[$5,-$4]
                              /&varSubStr@[$A,$^,$4,$5]
                              /&script$[@@clip01@@]}
                            Your message has been successfully submitted and would be delivered to recipients shortly.