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

[Clip] Automating File Saves

Expand Messages
  • lmhamilton@juno.com
    Hey Clippers! I am working on a clip to simplify saving often updated files to floppy, in this case web files with *.htm extension. It could easily be enhanced
    Message 1 of 4 , Jan 8, 2000
    • 0 Attachment
      Hey Clippers!

      I am working on a clip to simplify saving often updated files to floppy,
      in this case web files with *.htm extension. It could easily be enhanced
      to work with a wide variety of file types, and directories.

      Here is what I have so far. My problem is that it accesses the floppy
      drive, but when I look view the contents of A:\, the file(s) are not
      there. I checked and it is not write-protected. I must have some bad
      syntax in the copy command. I know a DOS command will do the trick, but
      why won't what I have below work? I started developing it in NTPro Beta
      14, so I made sure it was not an issue with the Beta and get the same
      results in NTPro 4.6a.

      Any help/pointers are greatly appreciated!

      :***********Start Clip******
      ;Lawrence M. Hamilton, Jr.
      ;January 01, 2000 - lmhamilton@...
      ^!ClearVariables
      ^!Set %Path%="C:\Program Files\NoteTab Std\Documents\HNGSSite\"
      ^!Set %File%=^$GetFileFirst(^%Path%;*.htm;REVDATE)$
      ^!Info File=^%File%
      :LOOP
      ^!Set %FileDate%=^$GetFileDate(^%File%)$
      ^!Info FileDate=^%FileDate%
      ^!Set %Today%=^$GetDate(yyyymmdd)$
      ^!If ^%FileDate% <> ^%Today% FINISH ELSE NEXT

      ^!Set %FileSave%=^%File%
      ^!Info FileSave=^%FileSave%
      ;WHAT IS WRONG WITH THE FOLLOWING LINE?
      ^!CopyFile "C:\Program Files\NoteTab Std\Documents\HNGSSite\^%FileSave%"
      "A:\"
      ;THE Following Alternate does the same thing.
      ;^!CopyFile "^%Path%^%FileSave%" "A:\"
      ^!Set %File%=^$GetFileNext$
      ^!GoTo LOOP

      :FINISH
      ^!CloseFileFind
      ;**********End Clip********

      TIA!


      Larry Hamilton, Jr. lmhamilton@...
      Hamilton National Genealogical Society, Inc.
      http://www.HamiltonGenSociety.org/
      My Web Site: http://notlimaH.tripod.com

      ________________________________________________________________
      YOU'RE PAYING TOO MUCH FOR THE INTERNET!
      Juno now offers FREE Internet Access!
      Try it today - there's no risk! For your FREE software, visit:
      http://dl.www.juno.com/get/tagj.
    • Jody
      Hi Larry H., ... A: Try: ^!CopyFile ^%FileSave% A: ^%File% already contains your full path including the file. You are adding it again in the copy
      Message 2 of 4 , Jan 8, 2000
      • 0 Attachment
        Hi Larry H.,

        > ^!Set %Path%="C:\Program Files\NoteTab Std\Documents\HNGSSite\"
        > ^!Set %File%=^$GetFileFirst(^%Path%;*.htm;REVDATE)$
        >...
        > ^!Set %FileSave%=^%File%
        >...
        > ^!CopyFile "C:\Program Files\NoteTab Std\Documents\HNGSSite\^%FileSave%"
        "A:\"

        Try:

        ^!CopyFile "^%FileSave%" "A:\"

        ^%File% already contains your full path including the file. You
        are adding it again in the copy thinking ^%FileSave% is only the
        filename. If you look at your first info box that comes up you
        should see the full path from ^$GetFileFirst$.

        Happy Clip'n!
        Jody

        http://www.sureword.com/notetab

        The NoteTab Clip List...
        mailto:Ntb-Clips-Subscribe@...
        mailto:Ntb-Clips-UnSubscribe@...
      • lmhamilton@juno.com
        Thanks, Jody. That was a little too simple.... Why didn t I think of that? I do not know why I did not get some form of error. I guess it was a valid path,
        Message 3 of 4 , Jan 8, 2000
        • 0 Attachment
          Thanks, Jody.

          That was a little too simple.... Why didn't I think of that?

          I do not know why I did not get some form of error. I guess it was a
          "valid" path, since its syntax was correct, even if that "double" path,
          did not exist.

          I even put in the info boxes to check the values of the variables, to
          confirm I had my logic flow correct.

          Oh, Well, you know what they say about hydrogen and stupidity!

          Larry

          On Sat, 08 Jan 2000 19:19:51 -0600 Jody <KJB1611@...> writes:
          > Hi Larry H.,
          >
          > > ^!Set %Path%="C:\Program Files\NoteTab Std\Documents\HNGSSite\"
          > > ^!Set %File%=^$GetFileFirst(^%Path%;*.htm;REVDATE)$
          > >...
          > > ^!Set %FileSave%=^%File%
          > >...
          > > ^!CopyFile "C:\Program Files\NoteTab
          > Std\Documents\HNGSSite\^%FileSave%"
          > "A:\"
          >
          > Try:
          >
          > ^!CopyFile "^%FileSave%" "A:\"
          >
          > ^%File% already contains your full path including the file. You
          > are adding it again in the copy thinking ^%FileSave% is only the
          > filename. If you look at your first info box that comes up you
          > should see the full path from ^$GetFileFirst$.
          >
          > Happy Clip'n!
          > Jody
          >
          > http://www.sureword.com/notetab
          >
          > The NoteTab Clip List...
          > mailto:Ntb-Clips-Subscribe@...
          > mailto:Ntb-Clips-UnSubscribe@...
          >
          >
          >
          ------------------------------------------------------------------------
          > Looking for educational tools for your kids?
          > Find everything you need at SmarterKids.com
          > http://click.egroups.com/1/645/3/_/2798/_/947380734/
          >
          > -- Create a poll/survey for your group!
          > -- http://www.egroups.com/vote?listname=ntb-clips&m=1
          >
          >

          ________________________________________________________________
          YOU'RE PAYING TOO MUCH FOR THE INTERNET!
          Juno now offers FREE Internet Access!
          Try it today - there's no risk! For your FREE software, visit:
          http://dl.www.juno.com/get/tagj.
        • Jody
          Hi lmhamilton, ... I didn t look for the error - just did them enough times making the same mistake in the beginning while learning... The help file is what
          Message 4 of 4 , Jan 8, 2000
          • 0 Attachment
            Hi lmhamilton,

            > I do not know why I did not get some form of error. I guess it
            > was a "valid" path, since its syntax was correct, even if that
            > "double" path, did not exist.

            I didn't look for the error - just did them enough times making
            the same mistake in the beginning while learning... The help
            file is what throws us off I think:

            GetFileFirst
            ^$GetFileFirst(FilePath;FileSpecs[;SortingOrder])$

            Returns the first file name in the list generated by the
            function.

            Should read something like: Returns the first file name and
            extension (including full path) in the list generated by the
            function.

            > Oh, Well, you know what they say about hydrogen and stupidity!

            <grin>

            The two most common elements in the
            universe are hydrogen and stupidity.

            Signed,
            I. Claim Ignorance

            Blessed are they who can laugh at themselves
            for they shall never cease to be amused.

            Clean-Funnies List
            mailto:CF@...?subject=subscribe
          Your message has been successfully submitted and would be delivered to recipients shortly.