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

Re: [peditors] Re: Long conversation re: pscripting question

Expand Messages
  • John Markley
    ... Super! Isn t this fun?? ... OK, I guessed as much and just finished the looong post below. First are the two pScripts for Bonsai that I think will work
    Message 1 of 37 , Feb 10, 2008
    • 0 Attachment
      > YES!! That works for both WalMart (which is first position) and
      > Errands (which is second position).
      >

      Super! Isn't this fun??

      > In Bonsai aFamily Information is first and aWeekly Agenda is second.
      >

      OK, I guessed as much and just finished the looong post below. First
      are the two pScripts for Bonsai that I think will work right off. They
      work on the position-in-index principle, so the one for aFamily
      Information will in fact open whatever is first. Following those two
      I've put position-in-index versions of the HS2 pScripts on the
      assumption that *Errands is first and **Walmart is second. Since what
      you have right now for HS2 is working you probably won't want to
      change, but if you do, there they are. Then finally, below the line of
      asterisks********** I've put all four pScripts again, but with
      pComment annotations so you can figure out how to alter them if you
      ever need to.

      Here you go --

      custBtn.001.3
      pScript_13
      {aFamily Information::
      /&launch[@@Bonsai@@]
      /&script$[@@Fam1@@]}
      {Fam1::
      /!/$f
      /&varSet@[$8,$$]
      /&ifScript@[$8!=1000,@@Fam2@@]
      /&ifScript@[$8==1000,@@Fam3@@]}
      {Fam2::
      /xc E /&script$[@@Fam3@@]}
      {Fam3::
      /&varSet@[$1,1]
      /:Z/0x1E
      /&varAdd@[$1,1]
      /&ifGoTo@[$1<17,@@Z@@]
      /xn}




      custBtn.001.4
      pScript_14
      {aWeekly Agenda::
      /&launch[@@Bonsai@@]
      /&script$[@@Weekly1@@]}
      {Weekly1::
      /!/$f
      /&varSet@[$8,$$]
      /&ifScript@[$8!=1000,@@Weekly2@@]
      /&ifScript@[$8==1000,@@Weekly3@@]}
      {Weekly2::
      /xc E /&script$[@@Weekly3@@]}
      {Weekly3::
      /&varSet@[$1,1]
      /:Z/0x1E
      /&varAdd@[$1,1]
      /&ifGoTo@[$1<17,@@Z@@]
      /0x1F
      /xn}


      custBtn.001.1
      pScript_11
      {*Errands::
      /&launch[@@HandyShop2@@]
      /&script$[@@Errands1@@]}
      {Errands1::
      /xc E /0x0D
      /0x0D}


      custBtn.001.2
      pScript_12
      {**WalMart::
      /&launch[@@HandyShop2@@]
      /&script$[@@WalMart1@@]}
      {WalMart1::
      /xc E /0x0D
      /0x0C
      /0x0D}





      *******annotated with pComments /*comment*/ --


      custBtn.001.1
      pScript_11
      {*Errands::
      /&launch[@@HandyShop2@@]
      /&script$[@@Errands1@@]}
      {Errands1::
      /xc E /*command E goes to Database list*/
      /0x0D /*carriage return puts selection focus on first item*/
      /0x0D} /*carriage return opens selected item*/


      custBtn.001.2
      pScript_12 /*same as pScript_11 except for /0x0C below*/
      {**WalMart::
      /&launch[@@HandyShop2@@]
      /&script$[@@WalMart1@@]}
      {WalMart1::
      /xc E /0x0D
      /0x0C /*page down, moves selection down one, to second item. Down
      arrow, 0x1F, does not work in this situation*/
      /0x0D}


      custBtn.001.3
      pScript_13
      {aFamily Information::
      /&launch[@@Bonsai@@]
      /&script$[@@Fam1@@]}
      {Fam1::
      /!/$f /* ! prevents $f from printing, $f sets $$ to form ID number*/
      /&varSet@[$8,$$] /*sets pVariable $8 to the form ID of the current form*/
      /&ifScript@[$8!=1000,@@Fam2@@] /*if the form is not ID 1000, go to Fam2*/
      /&ifScript@[$8==1000,@@Fam3@@]}/*if form is ID 1000, go to Fam3*/
      {Fam2::
      /xc E /* command E, close currently open list, go to database index*/
      /&script$[@@Fam3@@]}
      {Fam3::
      /&varSet@[$1,1] /*set pVariable $1 to have a value of 1*/
      /:Z/0x1E /*GoTo anchor Z, followed by up arrow*/
      /&varAdd@[$1,1] /*add one to pVariable $1*/
      /&ifGoTo@[$1<17,@@Z@@] /*if $1 is less than 17, go back to Z, repeat*/
      /xn} /*when $1 has reached 17, carriage return to open the now
      activated top item*/

      Further explanation - In HandyShopper command-E ("/xc E") does the same
      thing whether the database index or one of the lists is open, so the
      "/!/$f" is not needed. But in Bonsai, if an outline is still open when
      the pScript opens Bonsai command-E will close it and display the
      outline list (database index), but if Bonsai was left in the outline
      list last time around command-E gives the command to Export; not good.
      The form ID 1000 is the form for the database index list of outlines
      (if you want to know how to find this out it's in the manual, or ask
      me). So this pScript says, ok, what form am I in? If it's an open
      outline, not form 1000, close it and go to the database index using /xc
      E. If it is already in the index, form ID 1000, proceed without /xc E.
      Then, unlike in HandyShopper where the topmost item can be selected
      immediately and reproduceably always, using /0x0D, this does not work
      in Bonsai. In Bonsai the outline list always has whatever outline name
      was last used highlighted. So this pScript moves the selection upward
      17 times. This ensures that even if you last used your lowest on the
      list #15, the selection will now be on the top, #1. If you ever exceed
      17 items in Bonsai you will need to increase the number in
      "/&ifGoTo@[$1<17,@@Z@@]" accordingly. In this pScript, /xn then
      activates the selected top item. To get item #2, the "aWeekly Agenda"
      pScript adds "0x1F", arrow down, to move the selection down one, from
      item 1 to item 2, then opens it. Unlike in HS2, 0x1F works rather than
      0x0C.




      custBtn.001.4
      pScript_14
      {aWeekly Agenda:: /*same as aFamily Information except /0x1F*/
      /&launch[@@Bonsai@@]
      /&script$[@@Weekly1@@]}
      {Weekly1::
      /!/$f
      /&varSet@[$8,$$]
      /&ifScript@[$8!=1000,@@Weekly2@@]
      /&ifScript@[$8==1000,@@Weekly3@@]}
      {Weekly2::
      /xc E /&script$[@@Weekly3@@]}
      {Weekly3::
      /&varSet@[$1,1]
      /:Z/0x1E
      /&varAdd@[$1,1]
      /&ifGoTo@[$1<17,@@Z@@]
      /0x1F /* arrow down*/
      /xn}


      Cheers, John
    • John Markley
      ... Super! Isn t this fun?? ... OK, I guessed as much and just finished the looong post below. First are the two pScripts for Bonsai that I think will work
      Message 37 of 37 , Feb 10, 2008
      • 0 Attachment
        > YES!! That works for both WalMart (which is first position) and
        > Errands (which is second position).
        >

        Super! Isn't this fun??

        > In Bonsai aFamily Information is first and aWeekly Agenda is second.
        >

        OK, I guessed as much and just finished the looong post below. First
        are the two pScripts for Bonsai that I think will work right off. They
        work on the position-in-index principle, so the one for aFamily
        Information will in fact open whatever is first. Following those two
        I've put position-in-index versions of the HS2 pScripts on the
        assumption that *Errands is first and **Walmart is second. Since what
        you have right now for HS2 is working you probably won't want to
        change, but if you do, there they are. Then finally, below the line of
        asterisks********** I've put all four pScripts again, but with
        pComment annotations so you can figure out how to alter them if you
        ever need to.

        Here you go --

        custBtn.001.3
        pScript_13
        {aFamily Information::
        /&launch[@@Bonsai@@]
        /&script$[@@Fam1@@]}
        {Fam1::
        /!/$f
        /&varSet@[$8,$$]
        /&ifScript@[$8!=1000,@@Fam2@@]
        /&ifScript@[$8==1000,@@Fam3@@]}
        {Fam2::
        /xc E /&script$[@@Fam3@@]}
        {Fam3::
        /&varSet@[$1,1]
        /:Z/0x1E
        /&varAdd@[$1,1]
        /&ifGoTo@[$1<17,@@Z@@]
        /xn}




        custBtn.001.4
        pScript_14
        {aWeekly Agenda::
        /&launch[@@Bonsai@@]
        /&script$[@@Weekly1@@]}
        {Weekly1::
        /!/$f
        /&varSet@[$8,$$]
        /&ifScript@[$8!=1000,@@Weekly2@@]
        /&ifScript@[$8==1000,@@Weekly3@@]}
        {Weekly2::
        /xc E /&script$[@@Weekly3@@]}
        {Weekly3::
        /&varSet@[$1,1]
        /:Z/0x1E
        /&varAdd@[$1,1]
        /&ifGoTo@[$1<17,@@Z@@]
        /0x1F
        /xn}


        custBtn.001.1
        pScript_11
        {*Errands::
        /&launch[@@HandyShop2@@]
        /&script$[@@Errands1@@]}
        {Errands1::
        /xc E /0x0D
        /0x0D}


        custBtn.001.2
        pScript_12
        {**WalMart::
        /&launch[@@HandyShop2@@]
        /&script$[@@WalMart1@@]}
        {WalMart1::
        /xc E /0x0D
        /0x0C
        /0x0D}





        *******annotated with pComments /*comment*/ --


        custBtn.001.1
        pScript_11
        {*Errands::
        /&launch[@@HandyShop2@@]
        /&script$[@@Errands1@@]}
        {Errands1::
        /xc E /*command E goes to Database list*/
        /0x0D /*carriage return puts selection focus on first item*/
        /0x0D} /*carriage return opens selected item*/


        custBtn.001.2
        pScript_12 /*same as pScript_11 except for /0x0C below*/
        {**WalMart::
        /&launch[@@HandyShop2@@]
        /&script$[@@WalMart1@@]}
        {WalMart1::
        /xc E /0x0D
        /0x0C /*page down, moves selection down one, to second item. Down
        arrow, 0x1F, does not work in this situation*/
        /0x0D}


        custBtn.001.3
        pScript_13
        {aFamily Information::
        /&launch[@@Bonsai@@]
        /&script$[@@Fam1@@]}
        {Fam1::
        /!/$f /* ! prevents $f from printing, $f sets $$ to form ID number*/
        /&varSet@[$8,$$] /*sets pVariable $8 to the form ID of the current form*/
        /&ifScript@[$8!=1000,@@Fam2@@] /*if the form is not ID 1000, go to Fam2*/
        /&ifScript@[$8==1000,@@Fam3@@]}/*if form is ID 1000, go to Fam3*/
        {Fam2::
        /xc E /* command E, close currently open list, go to database index*/
        /&script$[@@Fam3@@]}
        {Fam3::
        /&varSet@[$1,1] /*set pVariable $1 to have a value of 1*/
        /:Z/0x1E /*GoTo anchor Z, followed by up arrow*/
        /&varAdd@[$1,1] /*add one to pVariable $1*/
        /&ifGoTo@[$1<17,@@Z@@] /*if $1 is less than 17, go back to Z, repeat*/
        /xn} /*when $1 has reached 17, carriage return to open the now
        activated top item*/

        Further explanation - In HandyShopper command-E ("/xc E") does the same
        thing whether the database index or one of the lists is open, so the
        "/!/$f" is not needed. But in Bonsai, if an outline is still open when
        the pScript opens Bonsai command-E will close it and display the
        outline list (database index), but if Bonsai was left in the outline
        list last time around command-E gives the command to Export; not good.
        The form ID 1000 is the form for the database index list of outlines
        (if you want to know how to find this out it's in the manual, or ask
        me). So this pScript says, ok, what form am I in? If it's an open
        outline, not form 1000, close it and go to the database index using /xc
        E. If it is already in the index, form ID 1000, proceed without /xc E.
        Then, unlike in HandyShopper where the topmost item can be selected
        immediately and reproduceably always, using /0x0D, this does not work
        in Bonsai. In Bonsai the outline list always has whatever outline name
        was last used highlighted. So this pScript moves the selection upward
        17 times. This ensures that even if you last used your lowest on the
        list #15, the selection will now be on the top, #1. If you ever exceed
        17 items in Bonsai you will need to increase the number in
        "/&ifGoTo@[$1<17,@@Z@@]" accordingly. In this pScript, /xn then
        activates the selected top item. To get item #2, the "aWeekly Agenda"
        pScript adds "0x1F", arrow down, to move the selection down one, from
        item 1 to item 2, then opens it. Unlike in HS2, 0x1F works rather than
        0x0C.




        custBtn.001.4
        pScript_14
        {aWeekly Agenda:: /*same as aFamily Information except /0x1F*/
        /&launch[@@Bonsai@@]
        /&script$[@@Weekly1@@]}
        {Weekly1::
        /!/$f
        /&varSet@[$8,$$]
        /&ifScript@[$8!=1000,@@Weekly2@@]
        /&ifScript@[$8==1000,@@Weekly3@@]}
        {Weekly2::
        /xc E /&script$[@@Weekly3@@]}
        {Weekly3::
        /&varSet@[$1,1]
        /:Z/0x1E
        /&varAdd@[$1,1]
        /&ifGoTo@[$1<17,@@Z@@]
        /0x1F /* arrow down*/
        /xn}


        Cheers, John
      Your message has been successfully submitted and would be delivered to recipients shortly.