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

Mailto pScript

Expand Messages
  • Marcus Williams
    Okay, so I ve written my first pScript. I still have a few questions! The script mailto sends selected text to a mail recipient. Well, what it actually does
    Message 1 of 7 , Nov 20, 2003
    • 0 Attachment
      Okay, so I've written my first pScript. I still have a few questions!
      The script "mailto" sends selected text to a mail recipient. Well,
      what it actually does is test to see if theres a selection and if so
      send that or if theres no selection it selects everything and sends
      that. You can have a few variations on this that fill in favourite
      email addresses as well (you can add email address in the "down"
      script before the movement commands) So heres the script (questions
      follow):

      /* script to mail current text */

      {mailto::
      /! /$l
      /&ifScript@ [$$==0, @@select@@]
      /&script [@@copy@@]
      }

      /* no selection needed, so just do a copy */

      {copy::
      /ec
      /&script [@@lmail@@]
      }

      /* selection needed, so do a select & copy */

      {select::
      /eS
      /&script [@@lmail@@]
      }

      /* launch internal mail */

      {lmail::
      /&launch [@@Mail@@]
      /&script [@@newmail@@]
      }

      /* select "New mail" from mail menu */

      {newmail::
      /&menu [100]
      /&script [@@down@@]
      }

      /* move down three fields to the Body textfield */

      {down::
      /xf /xf /xf
      /&script [@@paste@@]
      }

      /* paste the current clipboard */

      {paste::
      /ep
      }

      The questions are:

      1) Whilst I get the idea of chaining, the scripts above dont look like
      there the optimal way of doing what I'm trying to do - any suggestions
      on how to optimize?

      2) I still dont get the difference between "@" and "$" modifiers on
      things like /&script. Anyone want to explain?

      and theres probably more....

      Cheers

      Marcus

      --
      Marcus Williams -- http://www.quintic.co.uk
      Quintic Ltd, 39 Newnham Road, Cambridge, UK
    • Paul Nevai
      # 1) Whilst I get the idea of chaining, the scripts above dont look like # there the optimal way of doing what I m trying to do - any suggestions # on how to
      Message 2 of 7 , Nov 20, 2003
      • 0 Attachment
        # 1) Whilst I get the idea of chaining, the scripts above dont look like
        # there the optimal way of doing what I'm trying to do - any suggestions
        # on how to optimize?

        Get used to chaining. OS5 will reuire it more and more since you can't
        increase the size of the key event queue.

        # 2) I still dont get the difference between "@" and "$" modifiers on
        # things like /&script. Anyone want to explain?

        Actually, there are 3: /&script@ /&script and /&script$

        @ = do right now
        w/o = stay in the normal order
        $ = do it after all is finished - only /&script[] has this one

        This is needed because of the way the Palm handles events. It has 3 different
        kind of events: key, pen, and the rest. Key and pen are turned into "rest"
        one at a time and then the Palm processes them. But key and pen are always
        waiting till the "rest" was processed. Complicated? Yes, it is.

        If you write "a b c /©[] d e /&paste[]" (an example only), then the palm
        will do "/©[] /&paste[] a b c d e" unless you use some kind of modifier
        in the function to force them in the right order.

        Best regards, Paul
      • Marcus Williams
        ... Okay that make sense. So do key and pen events get converted in the order they are in the scripts? or do I get them converted like rest, key, pen? Marcus
        Message 3 of 7 , Nov 20, 2003
        • 0 Attachment
          On Thursday, November 20, 2003, at 09:56, you wrote:
          > This is needed because of the way the Palm handles events. It has 3 different
          > kind of events: key, pen, and the rest. Key and pen are turned into "rest"
          > one at a time and then the Palm processes them. But key and pen are always
          > waiting till the "rest" was processed. Complicated? Yes, it is.

          > If you write "a b c /©[] d e /&paste[]" (an example only), then the palm
          > will do "/©[] /&paste[] a b c d e" unless you use some kind of modifier
          > in the function to force them in the right order.

          Okay that make sense. So do key and pen events get converted in the
          order they are in the scripts? or do I get them converted like rest,
          key, pen?

          Marcus



          --
          Marcus Williams -- http://www.quintic.co.uk
          Quintic Ltd, 39 Newnham Road, Cambridge, UK
        • Paul Nevai
          # Okay that make sense. So do key and pen events get converted in the # order they are in the scripts? or do I get them converted like rest, # key, pen? Yes,
          Message 4 of 7 , Nov 20, 2003
          • 0 Attachment
            # Okay that make sense. So do key and pen events get converted in the
            # order they are in the scripts? or do I get them converted like rest,
            # key, pen?

            Yes, kind of. keys and pens have separate queues. Keys get converted first,
            then pens get converted. Each is done automatically and you can use chaining
            to influence the order.

            EXAMPLE. key1 key2 pen1 key3 BECOMES key1 key2 key3 pen1 UNLESS you chain.

            Key is ahead of pen all the time. That's why I introduced /&script$[] - last
            script to be able to have keys after pens.

            /Paul
          • Marcus Williams
            ... and rest is ahead of key (without modifiers) presumably. That makes it a lot clearer. Thanks. I m sure I ll have more questions after my next scripts :)
            Message 5 of 7 , Nov 20, 2003
            • 0 Attachment
              On Thursday, November 20, 2003, at 12:43, you wrote:
              > Key is ahead of pen all the time. That's why I introduced /&script$[] - last
              > script to be able to have keys after pens.

              and "rest" is ahead of key (without modifiers) presumably. That makes
              it a lot clearer. Thanks.

              I'm sure I'll have more questions after my next scripts :)

              Marcus

              --
              Marcus Williams -- http://www.quintic.co.uk
              Quintic Ltd, 39 Newnham Road, Cambridge, UK
            • Paul Nevai
              # and rest is ahead of key (without modifiers) presumably. That makes # it a lot clearer. Thanks. Yep. If someone wants to write it up for the masses , I d
              Message 6 of 7 , Nov 20, 2003
              • 0 Attachment
                # and "rest" is ahead of key (without modifiers) presumably. That makes
                # it a lot clearer. Thanks.

                Yep.

                If someone wants to write it up for the "masses", I'd be happy to put it into
                the manual.

                /Paul
              • Blake Winton
                ... There s a brief trace through of a program at: http://www.peditors.com/pages/BlakeWinton And I thought I did a couple of others, but can t find them now.
                Message 7 of 7 , Dec 2, 2003
                • 0 Attachment
                  > # and "rest" is ahead of key (without modifiers) presumably.
                  > # That makes it a lot clearer. Thanks.
                  >
                  > Yep.
                  >
                  > If someone wants to write it up for the "masses", I'd be
                  > happy to put it into the manual.

                  There's a brief trace through of a program at:
                  http://www.peditors.com/pages/BlakeWinton

                  And I thought I did a couple of others, but can't find them
                  now. Perhaps I only dreampt I did them. If people want to
                  send me more pScripts to trace through, I'ld be happy to put
                  them up on peditors.com.

                  Later,
                  Blake.
                Your message has been successfully submitted and would be delivered to recipients shortly.