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

Re: [NTB] No Save-As for Clip Editing

Expand Messages
  • Art Kocsis
    ... Sorry Eb, but I have to say this again - this is NOT a Save- as for the clip editor! There are three file images, all of which need to be captured: The
    Message 1 of 15 , May 20, 2012
    • 0 Attachment
      At 5/20/2012 12:11 PM, Eb wrote:
      >Art,
      >
      >I've used this technique on other stuff before. Sorry it didn't occur to
      >me sooner. The power of NoteTab to the rescue.
      >
      >It only takes 3 lines of clip code to provide a "Save AS" function for the
      >clip editor:
      >
      >^!SetFocus CLIPBOOK
      >; places the cursor into the clipbook
      >^!Keyboard &50 TAB &50 SHIFT+F10 &50 SHIFT+O
      >; tab to the title pane,
      >; SHIFT+F10 pops up incontext menu;
      >; O opens the library as document
      >^!Menu File/"Save AS"
      >
      >You will of course need to supply a name, and then close the document.
      >This code will run from the clipbar!

      Sorry Eb, but I have to say this again - this is NOT a "Save-
      as" for the clip editor!

      There are three file images, all of which need to be captured:
      The current open clip editor session, ==> <new_name>.clb
      The current on-disk file image, <orig_name>.clb
      The current on-disk backup file image, <orig_name>.bak

      Your clip only captures one - the current on-disk file image,
      <orig_name>.clb - NOT the open clip editor image. This image
      would be captured anyway by a normal "Save" file operation.

      The normal save captures only two of the images - the open
      cliplib image and the current on-disk image. It destroys the
      current on-disk backup file image. (The normal "Save" deletes
      the current <orig_name>.bak file, renames the current (last
      saved), on-disk image, <orig_name>.clb to <orig_name>.bak,
      and then saves the open document image to <orig_name>.clb).
      The file image captured by your clip would be identical to
      the new <orig_name>.bak.

      A true "save-as" command saves the current open document
      under a (potentially) different name, preserving both the
      current document saved file image as well as the last backup
      file image, and changes the open document name to the new
      document name.

      Your clip could be modified to rename the current backup
      file, <orig_name>.bak, to <orig_name>.sav and capture the
      critical file images but that still would not be a true
      "Save-As" for the clip editor.

      In order to implement a true "Save-As" you would have to:

      1) Get the current open cliplib file name - <orig_name>.clb
      2) Copy the current on-disk cliplib backup file image,
      <orig_name>.bak, to a new unique name, say,
      <orig_name>^$GetDate(hhnnss)$.sav
      3) Do a normal "Save" of the open clip editor session (which
      will rename the current <orig_name>.clb to <orig_name>.bak
      and save the current edit session to <orig_name>.clb.
      (Note: if the open cliplib is in a no-change status,
      "Save" will be disabled and no new <orig_name>.bak file
      will be created. That is why you must copy rather than
      rename in the previous step.)
      4) Rename the (now current), ON-DISK <orig_name>.clb file
      image to a new user supplied name, <new_name>.clb. Or,
      it might be better to create a unique new name and let the
      user rename it after the critical files are safely captured
      before autosave destroys the <orig_name>.bak file.
      5) Switch the clip editor focus to the renamed on-disk image,
      <new_name>.clb
      6) Rename the original cliplib on-disk image (which was
      preserved as <orig_name>.bak), back to <orig_name>.clb.
      7) Rename the original cliplib backup file image (which was
      preserved as <orig_name><unique_string>.sav), back to
      <orig_name>.bak.

      Remember, ^$GetDate(hhnnss)$ returns the current time
      values which may change during the execution of the clip
      so save it to a variable to use in the restoration.

      Thus the original on-disk file image and its back up image
      (if any), are preserved unchanged and the clip editor focus
      is in a renamed, captured image of the edit session.

      (At least they should be if I haven't messed up with a typo
      or brain crash. <g>)

      So, yes, it is possible (and not very difficult), to create such
      a rescue clip. It is just not as simple as you suggested. If
      you want to write it, we will be glad to use it.

      Art
    • Eb
      Art, Perhaps _you_ out to go back and read your own posts again, where you ask for a Save AS option in the clip editor. Then you might experiment with Save
      Message 2 of 15 , May 21, 2012
      • 0 Attachment
        Art,

        Perhaps _you_ out to go back and read your own posts again, where you ask for a "Save AS" option in the clip editor.

        Then you might experiment with Save AS. Pick any application, to see what you can realistically expect. Carefully monitor the various files you THINK are being affected.

        As long as you're just backing up, NoteTab's "Save AS" will save the current document in its current state to another name. That's all. Just like any other editor.

        The original file is left untouched in its last-saved state.
        The backup file is left untouched in its last-saved state.

        You even get this right in your post, once out of three different tries. See in-context comments to your post below.


        I leave it to you to figure out how my solution differs from the above. Hint, it does MORE that the normal Save AS.


        Eb

        --- In notetab@yahoogroups.com, Art Kocsis <artkns@...> wrote:
        >
        > >...
        >

        First you want to capture THREE files with Save AS:

        > There are three file images, all of which need to be captured:
        > The current open clip editor session, ==> <new_name>.clb
        > The current on-disk file image, <orig_name>.clb
        > The current on-disk backup file image, <orig_name>.bak

        Then you cotradict yourself, claiming that only one file is affected, since "preserving" means it leaves the file content "untouched":

        > A true "save-as" command saves the current open document
        > under a (potentially) different name, preserving both the
        > current document saved file image as well as the last backup
        > file image, and changes the open document name to the new
        > document name.

        Finally you come back to expecting Save As to copy three files, getting it wrong again:

        > In order to implement a true "Save-As" you would have to:
        >
        > 1) Get the current open cliplib file name - <orig_name>.clb
        > 2) Copy the current on-disk cliplib backup file image,
        > <orig_name>.bak, to a new unique name, say,
        > <orig_name>^$GetDate(hhnnss)$.sav

        Here is where I stopped reading. You are no longer just being argumetnative with the group, but with yourself as well.
      • Art Kocsis
        As this seems to be going nowhere, I will give it this one last try and then drop it. ... Exactly, IN THE CLIP EDITOR! It s already available elsewhere. ...
        Message 3 of 15 , May 23, 2012
        • 0 Attachment
          As this seems to be going nowhere, I will give it this one last try and
          then drop it.

          At 5/21/2012 07:54 AM, Eb wrote:
          >Perhaps _you_ out to go back and read your own posts again, where you ask
          >for a "Save AS" option in the clip editor.
          Exactly, IN THE CLIP EDITOR! It's already available elsewhere.


          >Then you might experiment with Save AS. Pick any application, to see what
          >you can realistically expect. Carefully monitor the various files you
          >THINK are being affected.
          >As long as you're just backing up, NoteTab's "Save AS" will save the
          >current document in
          >its current state to another name. That's all. Just like any other editor.
          >
          >The original file is left untouched in its last-saved state.
          >The backup file is left untouched in its last-saved state.

          That is exactly what I said - every time. And the Save As also saves the
          open doc under a new name and leaves the focus of the editor in the newly
          renamed document.

          Why do you keep going back to Save As in a regular doc? The subject has
          always been a Save As for the clip editor session.


          >I leave it to you to figure out how my solution differs from the above.
          >Hint, it does MORE that the normal Save AS.
          I'm not trying to make an enemy here but I this is simply not so.

          Your clip only loads the current clip editor cliplib as a regular document
          and opens the Save As menu. It does NOT save the open clip editor session
          at all, let alone under a new name nor return focus to a renamed cliplib in
          the clip editor.

          You ought to test it. I did. Enter a unique string in one of the clips in
          an UNSAVED clip edit session, run your clip and then try and find the
          string in your "Save-As" document. You won't.

          What is missing:
          The current clip editor session is not saved.
          The clip editor open cliplib is not renamed.
          The focus is not returned to the clip editor.


          --- In <mailto:notetab%40yahoogroups.com>notetab@yahoogroups.com, Art
          Kocsis <artkns@...> wrote:
          >First you want to capture THREE files with Save AS:
          >
          > > There are three file images, all of which need to be captured:
          > > The current open clip editor session, ==> <new_name>.clb
          > > The current on-disk file image, <orig_name>.clb
          > > The current on-disk backup file image, <orig_name>.bak
          >
          >Then you cotradict yourself, claiming that only one file is affected,
          >since "preserving" means it leaves the file content "untouched":
          My post detailed the steps needed to implement the functionality of a CLIP
          EDITOR SAVE AS. I did not contradict my self. FYI, copying and renaming
          files do not affect their contents. Since Notetab does not have a Save As
          feature for the clip editor, a clip has to do more to create the same final
          state. This involves copying ONE file and renaming others. When the clip is
          done, the state of the system is exactly as it would be if Notetab had a
          Save As for the clip editor:

          The original file content and name are left identical to its last-saved state.
          The backup file content and name are left identical to its last-saved state.
          The cliplib current clip editor session is saved under a new name
          The clip editor is open and focused in the newly named cliplib

          You can stop reading and close your mind but that does not change reality.

          I am not going to waste anymore of my or this forum's time on this thread.

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