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

Re: [peditors] WikiFodder:pScript contributions

Expand Messages
  • John Markley
    ... This is good. I hope there are lots of contributions. Here are some from me.... First, some general comments-- For those who may use this thread to
    Message 1 of 10 , Jun 23, 2006
      > Quoting Steve Kunkel <kunkel321@...>:
      >
      >> Hey John, awesome! Thanks for the contribution! Hope you don't mind, I've
      >> taken the liberty of putting your post in it's own thread.
      >> (this) Recent
      >> excavating of an ancient archaeological site indicates that in the past when
      >> things were put on the peditors.com site they were first tested by
      >> independent peditors. Following that orthodoxy is probably still a good
      >> idea. If folks test a pscript, please indicate which pscript(s) are tested,
      >> what device it was tested on and what your name (as in SteveK, JohnM, etc)
      >> is. Note that I prefixed the post with "WikiFodder:" to make it stand
      >> out--hopefully using somesuch convention will catch on ,,,

      This is good. I hope there are lots of contributions. Here are
      some from me....

      First, some general comments--
      For those who may use this thread to become acquainted with
      pScripting, I think the first thing you should do if you haven't
      already is read through the pScripting section of the pedit manual 2 or
      3 times, even if you can't (nobody can) absorb it all, just to have an
      idea of what's there. Then have a good backup system and start playing
      with pScripts.
      Paul has advised many times that the way to write pScripts is one
      part at a time, test that, add the next, test, etc. That's good
      advice. I'd suggest that if you try any of the pScripts in this
      WikiFodder thread, starting with yesterday's alpha, you do the same
      thing. That is, don't just copy it and run it and see what happens.
      Dissect it. Run the first segment and see what happens, then add the
      next, etc. It's more instructive that way.
      I've found pScriptButtons to be very helpful when writing pScripts.
      Via pToolPrefs I have a screen tap spot set to open pScriptPad and
      another to open pScriptButtons. I'll assign a script in process to a
      button so I can keep testing it, segment by segment, with just two
      taps, then back to the ScriptPad, etc. Once a pScript is done it then
      can be activated by any of the several activation mechanisms.
      Including, be sure to check out the mini-app runners. With these, any
      pScript can be transformed into an application that can be launched
      with pLaunchTool or any other app launcher.

      Three pScripts, all in the "pScripts I actually use every day" category-

      I use SnapperMail on my TX. The first script turns on WiFi on my TX,
      then launches SnapperMail and retrieves new mail. The second clears
      all the mail items from the inbox. The third empties the Snappermail
      trash. I have both a screen tap (pToolPrefs) and the center 5-way
      button (ButtonsEx) set to run the first one, and the other two are in
      my pScriptButtons list.

      {Snappermail::/&tap i [100,231] /*1*/
      /&script$[@@SN3@@]} /*2*/
      {SN3::/&tap i [070,143] /*3*/
      /&script$[@@SN4@@]} /*2*/
      {SN4::/0x0C /*4*/
      /&script$[@@SN5@@]} /*2*/
      {SN5::/xn /*5*/
      /&script$[@@SN6@@]} /*2*/
      {SN6::/&tap i [086,086] /*6*/
      /&script$[@@SN7@@]} /*2*/
      {SN7::/&launch[@@SnapperMail@@] /*7*/
      /xcM} /*8*/

      1-- taps WiFi button on control bar. "&tap"s are to be avoided in OS5
      as much as possible as the OS response is unreliable. However, there
      are several in this script as I couldn't find any other way to do it.
      If you use this you may need to change the coordinates for something
      other than a TX in portrait mode. One of the problems with &tap is
      that if full-screen-writing is turned on the OS may interpret the &tap
      command as a punctuation shift command. There are 3 ways around this
      (maybe more?)-- only run the script with full-screen turned off, start
      the pScript with a &tap to the screen-writing toggle itself(to my
      amazement this often works!!), or it you use TealScript, set the
      preference in Write Anywhere Tuning to "Disable for quick initial taps".
      2-- chain to avoid sequence conflict. In this particular script some
      of these may not be needed. Experiment to see. Note that each pScript
      name in your entire pScriptPad must be unique. If you have 2 or more
      with the same name there will be cross-talk activation with unintended
      results.
      3--taps to open the WiFi off/on toggle.
      4--moves the highlight from off to on (page down. The /Ox tokens
      sometimes will do things you need in unexpected ways. See the manual.
      Experiment.)
      5-- activates the on toggle (linefeed. same as 0x0A. see --4 above.)
      6-- taps the screen above the WiFi dialog to dismiss it.
      7-- launches SnapperMail
      8-- tells Snapper to send and receive.


      ---------------------------------------------------
      This script is to be activated while the inbox screen of Snapper is
      open and there are emails listed all of which you wish to trash in one
      fell swoop.

      {ClearMail::/xcS /*command-S, selects all*/
      /&script$[@@cm1@@]} /*chain*/
      {cm1::/xcD /*command-D, moves to trash*/
      /&script$[@@cm2@@]} /*chain*/ {cm2::/xcE
      /*command-E, empties the trash (see below)*/
      /&tap i [025,148]} /*taps to verify to empty trash*/

      ------------------------------------------------------

      {EmptyTrash::/xcE/&tap i [025,148]} /*this is the same as the
      last two segments of the script above. When there are more than two
      items in the list, the time lag involved in the move-to-trash process
      invalidates the xcE command. I haven't been able to find a way around
      this. Chaining, "/&sleep", and "&mess" won't do it. So if there are
      more than two emails being trashed, this script must be activated in
      addition to "ClearMail". It's still faster than doing it manually.*/

      -------------------
      ~ John
    • John Markley
      pScripts for capturing text strings: Some months ago a peditor (JimB) expressed the need to pScript the copy and paste of a specific length (18 characters)
      Message 2 of 10 , Jun 26, 2006
        pScripts for capturing text strings:

        Some months ago a peditor (JimB) expressed the need to pScript the
        copy and paste of a specific length (18 characters) string from the
        text field of one app and transfer it to another. This was a bit
        tricky at the time because pEditTool does not have the ability to
        select a substring. However, the pedit symmetric selector can do a
        repeat job. So a solution was to copy the text, transfer it to a new
        pedit memo, capture the first 18 characters to the clipboard, and then
        delete the temporary memo, leaving the desired string on the clipboard
        to be pasted wherever. That is the first pScript below. Jim's need
        led Paul to create "/&varSubStr[]". The second pScript below shows how
        that has turned the kludgy (but clever) solution into a simple and
        elegant one-step process, including the ability to capture a substring
        from anywhere within the total string, not just from the beginning.
        Both pScripts are to be initiated with a cursor active anywhere in the
        text from which the string is to be captured.


        {18toClip::/eS /*select all*/
        /&launch[@@peditPro@@] /*launch peditPro*/
        /&script$[@@clip2@@]} /*chain*/
        {clip2::/xEpro n /*peditPro ESC n opens a new peditPro memo*/
        /xEpro p /* ESC p pastes the clipboard text to the new memo*/
        /xEpro jh /* jumps the cursor to the start of text (home)*/
        /xEpro s 18c /* selects the first 18 characters*/
        /&script$[@@clip3@@]} /*chains to avoid event queue conflict*/
        {clip3::/ec /*copies the selected 18 character string to clipboard*/
        /xEpro D /*summons the delete dialog*/
        /&control[@@del@@]}

        /*deletes the memo so a bunch of unwanted 18 character memos
        won't accumulate. The desired 18 characters are now in the clipboard
        and the next step in the script would be to open whatever text field is
        desired and paste.*/

        Now compare this one-liner that does the same thing, except using
        pSringVariable set and print rather than copy and paste--

        {var18::/&varSubStr@[$F,$^,0,18]}

        /*copies first 18 characters to pStringVariable F. Now the
        next step would be to use "&varPrint[$F]" rather than "paste" to put
        the string wherever. */

        ~John
      • John Markley
        Just realized I should have made one additional comment in my earlier post today, ... ... The additional comment is that if /&varSubStr , or just
        Message 3 of 10 , Jun 26, 2006
          Just realized I should have made one additional comment in my earlier
          post today,

          > pScripts for capturing text strings:
          >
          <SNIP>

          > {var18::/&varSubStr@[$F,$^,0,18]}
          >
          > /*copies first 18 characters to pStringVariable F. Now the
          > next step would be to use "&varPrint[$F]" rather than "paste" to put
          > the string wherever. */

          The additional comment is that if "/&varSubStr", or just "/&varSet",
          is used to capture a string of more than 55 characters, the pSwitch "P"
          must be added to "/&varPrint", thus, "/&varPrint P [$F]", or only the
          first 55 characters will be printed. The upper case "P" switch turns
          off the 55 limit on varPrint.

          ~ John
        • John Markley
          There is an error in the original of this which I sent out a short while earlier today. I have removed it from the forum and am replacing with the following
          Message 4 of 10 , Jul 1, 2006
            There is an error in the original of this which I sent out a short
            while earlier today. I have removed it from the forum and am replacing
            with the following corrected version. If you received it by email,
            delete the earlier version and use this one.

            Quoting John Markley <jmmjr@...>:

            > pScript to find a memo if it exists, or if not to make one.
            >
            > I wrote this in response to an inquiry from MarcusW last February. The
            > object is to highlight some text and then run the pScript to either
            > open an existing memo if one exists with that exact name, ie memo first
            > line, or if it does not exist to make such a memo automatically.
            >
            > {FindMakeMemo::/ec /*1*/
            > /&launch [@@peditPro@@] /*2*/
            > /xEpro G /*3*/
            > /&script$[@@memo2@@]} /*4*/
            > {memo2::/ep /*5*/
            > /0x0A /*6*/
            > /&script$[@@memo3@@]} /*4*/
            > {memo3::/&ifAbort@ D f [$&==0] /*7*/
            > /&script$[@@memo4@@]} /*4*/
            > {memo4::/xEpro . /*8*/
            > /&script$[@@memo5@@]} /*4*/
            > {memo5::/xEpro n /*9*/
            > /xc p} /*10*/
            >
            > 1--copies the highlighted text
            > 2--the original pScript was written to be run from pedit. This allows
            > it to be run from any standard text in any app. 3-- peditPro ESC G
            > opens the Go to Memo dialog.
            > 4--chain to prevent key-event-queue conflict
            > 5-- paste the copied text (desired memo name) to the Go to Memo Text
            > line. Note; I wrote this to work with Go to Memo options set for
            > "Match Memo Start Only", "Search Memo Titles Only', and "Ignore Case"
            > checked and the others not checked. If you use different options you
            > might need to alter the script.
            > 6-- Linefeed. Activates the "Open" button. "/&control[]" would
            > probably work too.
            > 7-- This is the fun, tricky part. If a memo with the search name does
            > exist, it will now be open with a flashing cursor present and *no
            > highlighted text*. If no memo with the desired name exists, the Go to
            > Memo dialog will still be open with the search string *highlighted*,
            > and *no* flashing cursor present.
            > "/&ifAbort@ D f [$&==0]" says, if there is *no highlighted text* (ie
            > there is an existing memo), stop. If there *is* highlighted text (no
            > existing memo), go on to the next step. The debugger "D" just gives
            > you messages whether the pExpression is true or false and what the next
            > action is. It can be deleted to speed up the script if desired.
            > 8-- Closes the Go To dialog.
            > 9-- opens a new memo.
            > 10-- pastes the search string, thus producing the (new) desired memo.
            >
            > ~ John
            >
            >
            >
          • Steve Kunkel
            ... Hi John. The pScript looks good. I did have some difficulties with it, but I think that may be my fault... I don t hot sync from home, I just transfer
            Message 5 of 10 , Jul 3, 2006
              On 7/1/06, John Markley <jmmjr@...> wrote:
              >
              > There is an error in the original of this which I sent out a short
              > while earlier today. I have removed it from the forum and am replacing
              > with the following corrected version. If you received it by email,
              > delete the earlier version and use this one.
              >
              > Quoting John Markley <jmmjr@...>:
              >
              > > pScript to find a memo if it exists, or if not to make one.
              > >
              > > I wrote this in response to an inquiry from MarcusW last February. The
              > > object is to highlight some text and then run the pScript to either
              > > open an existing memo if one exists with that exact name, ie memo first
              > > line, or if it does not exist to make such a memo automatically.
              > >
              > > {FindMakeMemo::/ec /*1*/
              > > /&launch [@@peditPro@@] /*2*/
              > > /xEpro G /*3*/
              > > /&script$[@@memo2@@]} /*4*/
              > > {memo2::/ep /*5*/
              > > /0x0A /*6*/
              > > /&script$[@@memo3@@]} /*4*/
              > > {memo3::/&ifAbort@ D f [$&==0] /*7*/
              > > /&script$[@@memo4@@]} /*4*/
              > > {memo4::/xEpro . /*8*/
              > > /&script$[@@memo5@@]} /*4*/
              > > {memo5::/xEpro n /*9*/
              > > /xc p} /*10*/
              > >
              > > 1--copies the highlighted text
              > > 2--the original pScript was written to be run from pedit. This allows
              > > it to be run from any standard text in any app. 3-- peditPro ESC G
              > > opens the Go to Memo dialog.
              > > 4--chain to prevent key-event-queue conflict
              > > 5-- paste the copied text (desired memo name) to the Go to Memo Text
              > > line. Note; I wrote this to work with Go to Memo options set for
              > > "Match Memo Start Only", "Search Memo Titles Only', and "Ignore Case"
              > > checked and the others not checked. If you use different options you
              > > might need to alter the script.
              > > 6-- Linefeed. Activates the "Open" button. "/&control[]" would
              > > probably work too.
              > > 7-- This is the fun, tricky part. If a memo with the search name does
              > > exist, it will now be open with a flashing cursor present and *no
              > > highlighted text*. If no memo with the desired name exists, the Go to
              > > Memo dialog will still be open with the search string *highlighted*,
              > > and *no* flashing cursor present.
              > > "/&ifAbort@ D f [$&==0]" says, if there is *no highlighted text* (ie
              > > there is an existing memo), stop. If there *is* highlighted text (no
              > > existing memo), go on to the next step. The debugger "D" just gives
              > > you messages whether the pExpression is true or false and what the next
              > > action is. It can be deleted to speed up the script if desired.
              > > 8-- Closes the Go To dialog.
              > > 9-- opens a new memo.
              > > 10-- pastes the search string, thus producing the (new) desired memo.
              > >
              > > ~ John
              > >


              Hi John. The pScript looks good. I did have some difficulties with it, but
              I think that may be my fault... I don't hot sync from home, I just transfer
              files, apps, etc. to my T5 via File Transfer, then copy them from the card
              to the palm. Anyhoo, I what happened is (durring my copy'n'pasting) I got
              white space in some critical areas and it was messing up the script. THe
              reason I've mentioned this is because I suspect you've put the /* comments*/
              tabbed over to their own column for readability, but I think if this gets
              copy'n'pasted into people's scriptPad it could cause problems. I think it's
              only an issue in two places. THe space in the middle of /xEpro
              G /*3*/ seems to get inserted into the Go to Memo
              search field before the clipboard is pasted in. Also (again, I *think*) the
              space here: {memo2::/ep /*5*/
              /0x0A somehow disrupts the linefeed that would otherwise tap the OPEN
              button. When I ran it, it kept getting stuck in the Go to Memo form. THen,
              when I took the comments and extra space out it worked as expect. Please
              advise...

              Thanks again for the contribution!


              --
              SteveK
              =========================
              T5, Windows, PocketMirror, Anagram, DateBk6, Bonsai, pToolSet, Hi-Launcher,
              IconsPlus, PalmRevolt, Plucker, VillageSim,
              MyKbd, and-on-and-on.


              [Non-text portions of this message have been removed]
            • John Markley
              Quoting Steve Kunkel : When I ran it, it kept getting stuck in the Go to Memo form. THen, ... Yeah. I actually never put pComments in my
              Message 6 of 10 , Jul 3, 2006
                Quoting Steve Kunkel <kunkel321@...>:

                When I ran it, it kept getting stuck in the Go to Memo form. THen,
                > when I took the comments and extra space out it worked as expect. Please
                > advise...
                >

                Yeah. I actually never put pComments in my scripts in my own pScript
                pad cause it's so easy to make a little typo and screw it up. I keep
                an annotated set in a memo separate from the script pad. Best thing to
                do with all of these, I think, is to remove the comments before
                inserting in script pad. That said, I tried to be sure it would run
                with the numerical comments eg /*1*/ in the script, and it did, but
                sometimes the email process misaligns or deranges text a bit and that
                may be what happened to you. ? ~ John
              • Steve Kunkel
                ... word, saved-as a Txt file, transfered to the palm, opened in Docs to Go, copy into pedit, AND THEN into scriptPad !!! ;-) -- SteveK
                Message 7 of 10 , Jul 3, 2006
                  On 7/3/06, John Markley <jmmjr@...> wrote:
                  >
                  > Quoting Steve Kunkel <kunkel321@...>:
                  >
                  > When I ran it, it kept getting stuck in the Go to Memo form. THen,
                  > > when I took the comments and extra space out it worked as
                  > expect. Please
                  > > advise...
                  > >
                  >
                  > Yeah. I actually never put pComments in my scripts in my own pScript
                  > pad cause it's so easy to make a little typo and screw it up. I keep
                  > an annotated set in a memo separate from the script pad. Best thing to
                  > do with all of these, I think, is to remove the comments before
                  > inserting in script pad. That said, I tried to be sure it would run
                  > with the numerical comments eg /*1*/ in the script, and it did, but
                  > sometimes the email process misaligns or deranges text a bit and that
                  > may be what happened to you. ? ~ John
                  >
                  > Probably so. I'm sure it also didn't help that I copied from gmail into
                  word, saved-as a Txt file, transfered to the palm, opened in Docs to Go,
                  copy into pedit, AND THEN into scriptPad !!! ;-)

                  --
                  SteveK
                  =========================
                  T5, Windows, PocketMirror, Anagram, DateBk6, Bonsai, pToolSet, Hi-Launcher,
                  IconsPlus, PalmRevolt, Plucker, VillageSim,
                  MyKbd, and-on-and-on.


                  [Non-text portions of this message have been removed]
                • dmccunney
                  ... Er, why go through all that? I use GMail too. But for the above purpose, I d copy to Notespad or PFE. Those assume text files to begin with, so there s
                  Message 8 of 10 , Jul 3, 2006
                    On 7/3/06, Steve Kunkel <kunkel321@...> wrote:

                    > Probably so. I'm sure it also didn't help that I copied from gmail into
                    > word, saved-as a Txt file, transfered to the palm, opened in Docs to Go,
                    > copy into pedit, AND THEN into scriptPad !!! ;-)

                    Er, why go through all that?

                    I use GMail too. But for the above purpose, I'd copy to Notespad or
                    PFE. Those assume text files to begin with, so there's no SaveAs
                    required. Depending on which is more convenient, I'll either save the
                    text file to a card or I'll save it to the hard drive, then drop it
                    onto PInstall. PInstall is a free alternative to the Palm
                    QuickInstall feature, and can sync to RAM or a card. The nice bit
                    here is that text files passed to PInstall are converted on the fly to
                    Palm doc files.

                    If I save it to the card, I use CardTXT ot tejpWriter to retrieve it
                    from the card. Both can read ASCII text files from the card and
                    export them as doc or memo files. (Both are free, and tejpWriter is
                    open source, as well.)

                    I've discovered, incidentally, that text files convert best to doc
                    files if saved in Unix format, where only an LF delimits the end of a
                    line, instead of the CRLF DOS/Windows uses. Both PFA and Notespad
                    will do that.

                    NotesPad: http://www.newbie.com/NotesPad/
                    PFE: http://www.lancs.ac.uk/staff/steveb/cpaap/pfe/
                    CardTXT: http://www.freewarepalm.com/docs/cardtxt.shtml
                    tejpWriter: http://twriter.atspace.com/
                    PInstall: http://pinstall.envicon.com/e/pinstall/pinstall.html

                    > SteveK
                    ______
                    Dennis
                  • Steve Kunkel
                    ... Neat. PInstal works with WindowsXP--yes? -- SteveK ========================= T5, Windows, PocketMirror, Anagram, DateBk6, Bonsai, pToolSet, Hi-Launcher,
                    Message 9 of 10 , Jul 4, 2006
                      On 7/3/06, dmccunney <dennis.mccunney@...> wrote:
                      >
                      > On 7/3/06, Steve Kunkel <kunkel321@...> wrote:
                      >
                      > > Probably so. I'm sure it also didn't help that I copied from gmail into
                      > > word, saved-as a Txt file, transfered to the palm, opened in Docs to Go,
                      > > copy into pedit, AND THEN into scriptPad !!! ;-)
                      >
                      > Er, why go through all that?
                      >
                      > I use GMail too. But for the above purpose, I'd copy to Notespad or
                      > PFE. Those assume text files to begin with, so there's no SaveAs
                      > required. Depending on which is more convenient, I'll either save the
                      > text file to a card or I'll save it to the hard drive, then drop it
                      > onto PInstall. PInstall is a free alternative to the Palm
                      > QuickInstall feature, and can sync to RAM or a card. The nice bit
                      > here is that text files passed to PInstall are converted on the fly to
                      > Palm doc files.
                      >
                      > If I save it to the card, I use CardTXT ot tejpWriter to retrieve it
                      > from the card. Both can read ASCII text files from the card and
                      > export them as doc or memo files. (Both are free, and tejpWriter is
                      > open source, as well.)
                      >
                      > I've discovered, incidentally, that text files convert best to doc
                      > files if saved in Unix format, where only an LF delimits the end of a
                      > line, instead of the CRLF DOS/Windows uses. Both PFA and Notespad
                      > will do that.
                      >
                      > NotesPad: http://www.newbie.com/NotesPad/
                      > PFE: http://www.lancs.ac.uk/staff/steveb/cpaap/pfe/
                      > CardTXT: http://www.freewarepalm.com/docs/cardtxt.shtml
                      > tejpWriter: http://twriter.atspace.com/
                      > PInstall: http://pinstall.envicon.com/e/pinstall/pinstall.html
                      >
                      > > SteveK
                      > ______
                      > Dennis
                      >
                      Neat. PInstal works with WindowsXP--yes?

                      --
                      SteveK
                      =========================
                      T5, Windows, PocketMirror, Anagram, DateBk6, Bonsai, pToolSet, Hi-Launcher,
                      IconsPlus, PalmRevolt, Plucker, VillageSim,
                      MyKbd, and-on-and-on.


                      [Non-text portions of this message have been removed]
                    • dmccunney
                      ... It works on my Dell laptop running XP Pro... PInstall is the first thing I install on any PC after Palm Desktop. (And since I sync with Outlook, I
                      Message 10 of 10 , Jul 4, 2006
                        On 7/4/06, Steve Kunkel <kunkel321@...> wrote:
                        > On 7/3/06, dmccunney <dennis.mccunney@...> wrote:
                        > > On 7/3/06, Steve Kunkel <kunkel321@...> wrote:
                        > >
                        > > > Probably so. I'm sure it also didn't help that I copied from gmail into
                        > > > word, saved-as a Txt file, transfered to the palm, opened in Docs to Go,
                        > > > copy into pedit, AND THEN into scriptPad !!! ;-)
                        > >
                        > > Er, why go through all that?
                        > >
                        > > I use GMail too. But for the above purpose, I'd copy to Notespad or
                        > > PFE. Those assume text files to begin with, so there's no SaveAs
                        > > required. Depending on which is more convenient, I'll either save the
                        > > text file to a card or I'll save it to the hard drive, then drop it onto PInstall.
                        > > PInstall is a free alternative to the Palm QuickInstall feature, and can sync
                        > > to RAM or a card. The nice bit here is that text files passed to PInstall are
                        > > converted on the fly to Palm doc files.
                        >
                        > Neat. PInstal works with WindowsXP--yes?

                        It works on my Dell laptop running XP Pro...

                        PInstall is the first thing I install on any PC after Palm Desktop.
                        (And since I sync with Outlook, I basically never use Palm Desktop --
                        only the Hotsync Manager.)

                        PInstall will also let you sync at 256K/Sec, which I believe is double
                        the standard hotsync speed.

                        > SteveK
                        ______
                        Dennis
                      Your message has been successfully submitted and would be delivered to recipients shortly.