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

Re: [peditors] Newbie pScript question

Expand Messages
  • Paul Nevai
    # Sorry, not sure I included enough context: The number I want to increment is # in my document: I can t see how to get a number in a document into a #
    Message 1 of 20 , Feb 1, 2002
      # Sorry, not sure I included enough context: The number I want to increment is
      # in my document: I can't see how to get a number in a document into a
      # variable (e.g. cut/copy commands don't set $$ [which I don't complain about,
      # though if the selected text was all digits within the acceptable range...])

      I see... Steve? Can be done?

      # {cal::/&launch Df [@@Calculator@@,]}

      Works for me perfectly. Just tried it with m505 and both pedit and LTH.

      Do you see anything on the screen when you try it? What? /Paul
    • Steven Hill
      ... I spent a lot of time thinking about this a while back, and ultimately opted for the date stamp idea. I think the following method will work but I decided
      Message 2 of 20 , Feb 1, 2002
        At 07:42 -0500 1/2/02, Paul Nevai wrote:

        ># Sorry, not sure I included enough context: The number I want to increment is
        ># in my document: I can't see how to get a number in a document into a
        ># variable (e.g. cut/copy commands don't set $$ [which I don't complain about,
        ># though if the selected text was all digits within the acceptable range...])
        >
        >I see... Steve? Can be done?

        I spent a lot of time thinking about this a while back, and
        ultimately opted for the date stamp idea. I think the following
        method will work but I decided (having discovered that a datestamp
        did the job) not to try it out, so there may be a problem I haven't
        thought about...

        You need a script that copies the number, goes into scriptPad and
        finds and then pastes into the /&varSet[] function. Finally you need
        to launch the script that contains the /&varSet[] function and
        increment it the variable before printing it. Obviously you need an
        unique identifier in the script to allow you to find the /&varSet[]
        function, something like:

        /&varSet [$0, xxxx]/*PASTEHERE*/

        then you can find 'PASTEHERE', move the cursor back and then select
        word. Note that the starting script needs to be *after* the second
        script in scriptPad or it just finds the instruction for typing
        'PASTEHERE'!

        The other approach using a calculator application would also work. I
        would recommend EasyCalc as this allows you to paste a number,
        perform an operation on it and then copy the result. I posted a
        number of scripts that used EasyCalc a long time ago, and a search
        for 'EasyCalc' in the forum archive should allow you to find them.

        Hope this helps...

        Steven
        --
      • Steven Hill
        ... Replying to my own messages again... This is a pScript that works as described above. {doIncrement:: /&varSet [$0, xxx]/*PASTEHERE*/ /&varAdd [$0, 1]
        Message 3 of 20 , Feb 1, 2002
          At 12:57 +0000 1/2/02, Steven Hill wrote:

          >You need a script that copies the number, goes into scriptPad and
          >finds and then pastes into the /&varSet[] function. Finally you need
          >to launch the script that contains the /&varSet[] function and
          >increment it the variable before printing it. Obviously you need an
          >unique identifier in the script to allow you to find the /&varSet[]
          >function, something like:
          >
          >/&varSet [$0, xxxx]/*PASTEHERE*/
          >
          >then you can find 'PASTEHERE', move the cursor back and then select
          >word. Note that the starting script needs to be *after* the second
          >script in scriptPad or it just finds the instruction for typing
          >'PASTEHERE'!

          Replying to my own messages again...

          This is a pScript that works as described above.

          {doIncrement::
          /&varSet [$0, xxx]/*PASTEHERE*/
          /&varAdd [$0, 1]
          /&varPrint [$0]
          /0x04
          }

          {newIDno::
          /GZ
          /&varSet [$0, 0]
          `c
          `M`jh
          `fPASTEHERE`f
          /0x1c
          `jb4c
          `sw
          `p
          `o
          /&script [@@doIncrement@@]
          }

          Select any number, and run the newIDno script. If the selection isn't
          a number it is over written with some garbage so beware. If the
          number has leading zeros or spaces it will work, but the result
          doesn't have leading zeros or spaces...

          Steven
          --
        • Urs Hunkler
          [...] ... increment is ... about, ... range...]) [...] hi chris, the following part of the manual describes imo what you look for: The token /e# [home]
          Message 4 of 20 , Feb 1, 2002
            [...]
            > Sorry, not sure I included enough context: The number I want to
            increment is
            > in my document: I can't see how to get a number in a document into a
            > variable (e.g. cut/copy commands don't set $$ [which I don't complain
            about,
            > though if the selected text was all digits within the acceptable
            range...])
            [...]

            hi chris,

            the following part of the manual describes imo what you look for:

            The token "/e#" [home] checks if there is a currently focused text
            field. Then it assigns the value of the integer number which is either
            right after the cursor or at the beginning of the current text selection
            to the currValue [$$] pVariable. If there is no number there, then the
            currValue is set to 0 [zero].

            when you select the number, you can increment it and write it back at
            the same place.

            hth /urs

            --
            urs hunkler                          u.hunkler@...
            wir design gmbh                      fon +49. 5 31. 8 88 10
            38118 braunschweig                  fax +49. 5 31. 8 88 12 34
            sophienstrasse 40                    germany
          • Steven Hill
            ... oops... I had forgotten about that one (did I ever know!?), which makes my script unnecessary Steven --
            Message 5 of 20 , Feb 1, 2002
              At 14:43 +0100 1/2/02, Urs Hunkler wrote:

              >the following part of the manual describes imo what you look for:
              >
              >The token "/e#" [home] checks if there is a currently focused text
              >field. Then it assigns the value of the integer number which is either
              >right after the cursor or at the beginning of the current text selection
              >to the currValue [$$] pVariable. If there is no number there, then the
              >currValue is set to 0 [zero].
              >
              >when you select the number, you can increment it and write it back at
              >the same place.

              oops... I had forgotten about that one (did I ever know!?), which
              makes my script unnecessary

              Steven
              --
            • Paul Nevai
              # The token /e# [home] checks if there is a currently focused text # field. Then it assigns the value of the integer number which is either # right after the
              Message 6 of 20 , Feb 1, 2002
                # The token "/e#" [home] checks if there is a currently focused text
                # field. Then it assigns the value of the integer number which is either
                # right after the cursor or at the beginning of the current text selection
                # to the currValue [$$] pVariable. If there is no number there, then the
                # currValue is set to 0 [zero].
                #
                # when you select the number, you can increment it and write it back at
                # the same place.

                Yet another proof that I am no longer in charge of the genie. Seriously.
                /Paul
              • Paul Nevai
                # oops... I had forgotten about that one (did I ever know!?), which # makes my script unnecessary I kind of remember that you requested it BUT we both forgot
                Message 7 of 20 , Feb 1, 2002
                  # oops... I had forgotten about that one (did I ever know!?), which
                  # makes my script unnecessary

                  I kind of remember that you requested it BUT we both forgot it... /Paul
                • Urs Hunkler
                  [...] ... /Paul [...] hi paul, as i remember it was norbert back from his excursion with the wish to add some numbers in a memo. /urs -- urs
                  Message 8 of 20 , Feb 1, 2002
                    [...]
                    > I kind of remember that you requested it BUT we both forgot it...
                    /Paul
                    [...]

                    hi paul,

                    as i remember it was norbert back from his excursion with the wish to
                    add some numbers in a memo.

                    /urs

                    --
                    urs hunkler                          u.hunkler@...
                    wir design gmbh                      fon +49. 5 31. 8 88 10
                    38118 braunschweig                  fax +49. 5 31. 8 88 12 34
                    sophienstrasse 40                    germany
                  • Chris Parsons
                    Everyone, thanks for the help, sorry that *I* missed /e# ! ... I don t see anything on the screen after I type the pscript name and press ... Further
                    Message 9 of 20 , Feb 1, 2002
                      Everyone, thanks for the help, sorry that *I* missed /e# !

                      As for LTH-seeming-to-not-run-my-script:

                      ># {cal::/&launch Df [@@Calculator@@,]}
                      >
                      >Works for me perfectly. Just tried it with m505 and both pedit and LTH.
                      >
                      >Do you see anything on the screen when you try it? What? /Paul
                      >

                      I don't see anything on the screen after I type the pscript name and press
                      :D

                      Further investigation shows that none of the pscripts I've tried execute via
                      LapTopHack, but do in pedit.

                      e.g. {boz:: A }

                      Inserts the letter A in a pedit memo, but has no effect via LapTopHack when
                      in a Datebook appoinment description field.

                      I have LTH version 5.991 and pedit 5.91. The only other hack I have is
                      McPhiling (application switcher) which I've unticked in X-master. I also use
                      JackFlash, but neither LTH or pedit are in flash.

                      I did originally have LTH and peditLight and so couldn't use
                      scripts/peditHack. Then I installed pedit08. If I didn't do that right,
                      could LTH still be believing that it can't do pscripts? Should I use
                      peditFixer to do something?

                      Thanks

                      Chris

                      _________________________________________________________________
                      Join the world�s largest e-mail service with MSN Hotmail.
                      http://www.hotmail.com
                    • Paul Nevai
                      # Inserts the letter A in a pedit memo, but has no effect via LapTopHack when # in a Datebook appoinment description field. # # I have LTH version 5.991 and
                      Message 10 of 20 , Feb 1, 2002
                        # Inserts the letter A in a pedit memo, but has no effect via LapTopHack when
                        # in a Datebook appoinment description field.
                        #
                        # I have LTH version 5.991 and pedit 5.91. The only other hack I have is
                        # McPhiling (application switcher) which I've unticked in X-master. I also use
                        # JackFlash, but neither LTH or pedit are in flash.

                        I have no answers except that both LTH and pedit are ancient. Get the latest
                        and try again.

                        home.columbus.rr.com/nevai/palm/pc_beta.zip

                        BTW, pedit can be in the flash. /Paul
                      • Chris Parsons
                        Hi Paul I posted some messages last week because I had some trouble running pScripts in LapTopHack rather than pedit. You advised me to upgrade my versions of
                        Message 11 of 20 , Feb 5, 2002
                          Hi Paul

                          I posted some messages last week because I had some trouble running pScripts
                          in LapTopHack rather than pedit. You advised me to upgrade my versions of
                          LTH & pedit, which I did, and now things work fine. I think it was the pedit
                          update that did the trick.

                          Thanks

                          Chris


                          >I've tried it as far as launching the calculator and that works OK when the
                          >script is launced inside pedit, but not via LTH (from Datebook4 or
                          >Applications page). I can't see anything in the manual about /&launch not
                          >working in LTH pscripts - or did I miss it?
                          >



                          _________________________________________________________________
                          Chat with friends online, try MSN Messenger: http://messenger.msn.com
                        • Paul Nevai
                          # I posted some messages last week because I had some trouble running pScripts # in LapTopHack rather than pedit. You advised me to upgrade my versions of #
                          Message 12 of 20 , Feb 6, 2002
                            # I posted some messages last week because I had some trouble running pScripts
                            # in LapTopHack rather than pedit. You advised me to upgrade my versions of
                            # LTH & pedit, which I did, and now things work fine. I think it was the pedit
                            # update that did the trick.

                            Probaly your pedit and LTH were out of sync. /Paul
                          Your message has been successfully submitted and would be delivered to recipients shortly.