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

Re: [Clip] clip code for automatically returning to source document

Expand Messages
  • Don Passenger
    just record the cursor position at start by writing to variable and on return, set cursor to that variable position you may need to write the cursor variables
    Message 1 of 3 , Oct 19, 2003
    • 0 Attachment
      just record the cursor position at start by writing to variable
      and on return, set cursor to that variable position
      you may need to write the cursor variables

      here is a little piece I used once which is close:
      ;Store position of cursor
      ^!Set %TextPos%=^$GetRow$
      ;Move the cursor back to the saved position
      ^!SetCursor ^%TextPos%:1

      This one obviously goes to variable row and position 1.

      I think I have one that does exactly what you want ... I am looking for it.


      --

      Don Passenger

      If you need an html fix visit
      http://www.htmlfixit.com

      html/perl/php/xhtml/javascript presented
      in easy tutorials with live help and forums
      to fix your problems
      ----- Original Message -----
      From: "Jeff Scism" <scismgenie@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Sunday, October 19, 2003 9:59 AM
      Subject: [Clip] clip code for automatically returning to source document


      > Is there a way to tell notetab to return to the original source document
      > (at the top, or last cursor position) after cutting and pasting to a
      > NEW document?
      > --
      > ~~~~
      >
      > Jeff Scism, IBSSG
      > http://blacksheep.rootsweb.com/
      >
      >
      >
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
    • Don Passenger
      try this it is getting closer: ^!Jump Select_End ^!Set %cursor_row%=^$GetRow$ ^!Set %cursor_col%=^$GetCol$ ^!Find ^P CIS ^!Jump Select_Start ^!SelectTo
      Message 2 of 3 , Oct 19, 2003
      • 0 Attachment
        try this it is getting closer:
        ^!Jump Select_End
        ^!Set %cursor_row%=^$GetRow$
        ^!Set %cursor_col%=^$GetCol$
        ^!Find "^P" CIS
        ^!Jump Select_Start
        ^!SelectTo ^%cursor_row%:^%cursor_col%
        ^!InsertHtml <br />^$GetSelection$</p>
      • Larry Thomas
        Hi Jeff and Don, ... I believe that you are referring to the document tabs rather than the cursor position in the current document as Don seems to suggest in
        Message 3 of 3 , Oct 19, 2003
        • 0 Attachment
          Hi Jeff and Don,

          At 06:59 AM 10/19/03 -0700, you wrote:
          >Is there a way to tell notetab to return to the original source document
          >(at the top, or last cursor position) after cutting and pasting to a
          >NEW document?

          I believe that you are referring to the document tabs rather than the
          cursor position in the current document as Don seems to suggest in his
          post. You do mention the cursor position in your post but only in
          association with returning to the source document. If you want to always
          go to the top of the document, just place the code ^!Jump 1 at the end of
          your code and that will always place the cursor at the top of the document
          in focus or at the top of the current topic in an outline document. If you
          want the cursor to return to its previous position in the document you only
          need to switch tabs back to the source document and the cursor will be
          located in that position.

          To switch document tabs in a clip you need to use the code below:

          ^$GetDocIndex$
          ^$GetDocIndex(Name)$
          Returns the index position of the active document, or the document refered
          by the Name parameter

          ^!SetDocIndex IndexValue
          Activates the document at the specified position in the tab bar. First
          document is 1.


          Just set a variable before you switch to a new document. Here is an example:

          ;Before you open the new document and paste to it

          ^!Set %IDX%=^$GetDocIndex$

          ;Which stores the index for the current document tab in the variable ^%IDX%

          ^!Toolbar Paste New

          ;Opens a new document and pastes the cut/copied text into it.

          ^!SetDocIndex ^%IDX%

          ;Returns the focus to the previous document tab that was in focus when the
          ^!Toolbar Paste New command
          ;was executed. The cursor position will be where it was when the clip
          switched it to the new document.

          ;If you want the cursor at the top just add

          ^!Jump 1


          Regards,

          Larry
          lrt@... e¿ê
        Your message has been successfully submitted and would be delivered to recipients shortly.