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

Need some help with a pScript

Expand Messages
  • Tammy Cravit
    Hi, all, I m trying to create a pScript that I can use to copy/paste random stuff into my peditPro myNotes, and I m running into a problem. Here s the script
    Message 1 of 7 , Mar 31, 2006
      Hi, all,

      I'm trying to create a pScript that I can use to copy/paste random stuff
      into my peditPro myNotes, and I'm running into a problem.

      Here's the script I'm using:

      {append_mynotes::
      /ec /* Copy focused text */
      /&launch[@@peditPro@@] /* Open pEdit */
      /eq /* Go to listView */
      /&control[@@myNotes@@] /* Tap on myNotes */
      /ep /* Paste the text in */
      }

      When I run it (via the pToolSet pScriptTool), the selected text is copied,
      peditPro opens, the myNotes button is tapped. But the selected text is never
      pasted. (If I tap the "P" button, I can paste it in, so I know the
      select/copy is working.) I'm not a pScripting expert, so I'm at a bit of a
      loss as to how to fix this.

      Can anyone help?

      Thanks!
      Tammy
    • Paul Nevai
      # Here s the script I m using: # # {append_mynotes:: # /ec /* Copy focused text */ # /&launch[@@peditPro@@] /* Open pEdit */ # /eq
      Message 2 of 7 , Mar 31, 2006
        # Here's the script I'm using:
        #
        # {append_mynotes::
        # /ec /* Copy focused text */
        # /&launch[@@peditPro@@] /* Open pEdit */
        # /eq /* Go to listView */
        # /&control[@@myNotes@@] /* Tap on myNotes */
        # /ep /* Paste the text in */
        # }
        #
        # When I run it (via the pToolSet pScriptTool), the selected text is copied,
        # peditPro opens, the myNotes button is tapped. But the selected text is never
        # pasted. (If I tap the "P" button, I can paste it in, so I know the
        # select/copy is working.) I'm not a pScripting expert, so I'm at a bit of a
        # loss as to how to fix this.

        Hi Tammy:

        I am sure you will get help. I just say "/ep" is "right now". Chaining will
        help. Or replace "/ep" by "/xEpro p". That might work.

        All=my=best, Paul
      • Tammy Cravit
        Hi, Paul, ... Thanks for the help. I ve managed to get the script working now, though there s a not found message that pops up before myNotes is opened whose
        Message 3 of 7 , Mar 31, 2006
          Hi, Paul,

          > I am sure you will get help. I just say "/ep" is "right now".
          > Chaining will
          > help. Or replace "/ep" by "/xEpro p". That might work.

          Thanks for the help. I've managed to get the script working now, though
          there's a "not found" message that pops up before myNotes is opened whose
          origin remains a mystery to me.

          For the curious -- either anyone who can help me run down the spurious
          message, or who wants to use my script -- here's what I have now. I've added
          checking for a selection before the script runs, as well.

          --------------------------------------------------
          {append_mynotes::
          /! /$s /&varSet@ [$0, $$]
          /! /$S /&ifScript@ [$0==$$, @@appendNoSelection@@]
          /ec
          /&launch[@@peditPro@@]
          /&script [@@appender2@@]
          }
          {appender2::
          /eq
          /xEpro
          N
          /xEpro
          p
          }
          {appendNoSelection::
          /&mess [@@No selected text@@,,250]
          }
          --------------------------------------------------

          My first real pScript - yay me! :)

          - Tammy
        • John Markley
          ... Tammy- Paul has put you on the right track. I m pressed for time, but a lttle later I ll come back and prffer a bit more help it you ve not already posted
          Message 4 of 7 , Mar 31, 2006
            Quoting Paul Nevai <nevai@...-state.edu>:

            > Hi Tammy:
            >
            > I am sure you will get help. I just say "/ep" is "right now".
            > Chaining will
            > help. Or replace "/ep" by "/xEpro p". That might work.
            >
            > All=my=best, Paul

            Tammy- Paul has put you on the right track. I'm pressed for time, but
            a lttle later I'll come back and prffer a bit more help it you've not
            already posted that you've solved it....

            ~ JohnM
          • John Markley
            ... Nice going, yay you indeed. Couple of comments- 1) I think you don t need the eq . If you start {appender2:: with /xEpro N it should do the same thing,
            Message 5 of 7 , Mar 31, 2006
              Quoting Tammy Cravit <tammy.lists@...>:

              > Hi, Paul,
              > Thanks for the help. I've managed to get the script working now,
              > though
              > there's a "not found" message that pops up before myNotes is opened
              > whose
              > origin remains a mystery to me.
              >
              > For the curious -- either anyone who can help me run down the
              > spurious
              > message, or who wants to use my script -- here's what I have now.
              > I've added
              > checking for a selection before the script runs, as well.
              >
              > --------------------------------------------------
              > {append_mynotes::
              > /! /$s /&varSet@ [$0, $$]
              > /! /$S /&ifScript@ [$0==$$, @@appendNoSelection@@]
              > /ec
              > /&launch[@@peditPro@@]
              > /&script [@@appender2@@]
              > }
              > {appender2::
              > /eq
              > /xEpro
              > N
              > /xEpro
              > p
              > }
              > {appendNoSelection::
              > /&mess [@@No selected text@@,,250]
              > }
              > --------------------------------------------------
              >
              > My first real pScript - yay me! :)
              >
              > - Tammy

              Nice going, yay you indeed.

              Couple of comments-
              1) I think you don't need the "eq". If you start {appender2:: with
              /xEpro N it should do the same thing, no need to go to list view first.
              2) In general when you're chaining scripts it generally works best to
              make the /&script "last action", ie /&script$[].
              3) Usually messages such as "not found" that appear unexpectedly in
              pScripts are help messages Paul has built in to guide us out of error.
              :) However, I've run your script on my TX and it runs fine with no
              message. ??
              4) Am curious-- why do you want to print ",,250" when there's no
              highlighted text to copy?
              ~ JohnM
            • Tammy Cravit
              Hi, John, ... I ll try that...thanks! ... What s the difference between the two forms? ... I copied that code from a sample I found on (I think)
              Message 6 of 7 , Mar 31, 2006
                Hi, John,

                > 1) I think you don't need the "eq". If you start {appender2:: with
                > /xEpro N it should do the same thing, no need to go to list
                > view first.

                I'll try that...thanks!

                > 2) In general when you're chaining scripts it generally
                > works best to
                > make the /&script "last action", ie /&script$[].

                What's the difference between the two forms?

                > 4) Am curious-- why do you want to print ",,250" when there's no
                > highlighted text to copy?

                I copied that code from a sample I found on (I think)
                peditors.com...according to the documentation, the ",,250" tells /&mess to
                display the message for 250/100ths of a second.

                I'm not sure where the spurious "not found" message is coming from, but I
                guess working it out will be another learning experience.

                Thanks for yoru input!

                Tammy
              • John Markley
                ... One of the things that can cause a pScript to fail is having an action occur at a time in the sequence that is not when you intended, as you ve already
                Message 7 of 7 , Mar 31, 2006
                  Quoting Tammy Cravit <tammy.lists@...>:

                  >> 2) In general when you're chaining scripts it generally
                  >> works best to
                  >> make the /&script "last action", ie /&script$[].
                  >
                  > What's the difference between the two forms?

                  One of the things that can cause a pScript to fail is having an
                  action occur at a time in the sequence that is not when you intended,
                  as you've already seen. The "$" makes sure that your "&script$[]" is
                  the last thing to occur in the current script. The plain "runtime"
                  $script[] might not always run as the last action in the script, which
                  is usually what you want. There is also a "right now" version,
                  "&script@[]" which will jump to the start of the event queue.

                  >> 4) Am curious-- why do you want to print ",,250" when there's no
                  >> highlighted text to copy?
                  >
                  > I copied that code from a sample I found on (I think)
                  > peditors.com...according to the documentation, the ",,250" tells
                  > /&mess to
                  > display the message for 250/100ths of a second.

                  Oh, of course. My error--you have it right. I transcribed that
                  *after* the [] brackets, which of course prints it. Sorry, that was a
                  brain bleep on my part, I've used the ",y,s" many times. :/

                  >
                  > I'm not sure where the spurious "not found" message is coming from,
                  > but I
                  > guess working it out will be another learning experience.

                  Yes, that's mysterious. Look for a couple of things.. 1)do you have
                  any other pScripts in your pScriptPad that have the same script
                  identifiers as in this one? That can produce some very unexpected
                  results. 2)make sure your pedit Esc character is different than your
                  pToolSet Esc character, although I doubt that would do this.

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