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

Re: [Clip] running a clip on all files in a directory

Expand Messages
  • Steve LaMantia
    Thanks, Jody. I ll give that clip a whirl after work tonight. ... Excellent! Thanks! -- Steve
    Message 1 of 7 , Jan 1, 2005
      Thanks, Jody. I'll give that clip a whirl after work tonight.

      > > By the way, in code, what's the way to tell when Document Next
      > > has reached the last file? I can see doing it via variables and
      > > storing each filename before going Next and then comparing it to
      > > see if it's the same, but is there a better way?

      > ^!If ^$GetDocCount$ = ^$GetDocIndex$

      Excellent! Thanks!

      -- Steve
    • Jody
      Hi Steve, ... Reading between the lines it appears you want to do something with each file that opens. Using the code above, you do not need to know when you
      Message 2 of 7 , Jan 1, 2005
        Hi Steve,

        >H=Open Directory... Basic
        >
        >^!SetListDelimiter ^p
        >^!SetArray %OpenList%=^$GetFiles("^%Subs%^%Folder%";^%Type%)$
        >^!Set %Count%=^%OpenList0%
        >^!Set %Index%=0
        >
        >:Loop
        >^!Inc %Index%
        >^!If ^%Index% > ^%Count% End
        >^!Open ^%OpenList^%Index%%
        >^!Goto Loop

        Reading between the lines it appears you want to do something
        with each file that opens. Using the code above, you do not need
        to know when you are at the last document. In other words, you do
        not use ^!Document Next/Last. Instead, right after the ^!Open
        command you do what you need to edit the file, then ^!Close Save.
        For instance:

        ^!Open ^%OpenList^%Index%%
        ^!Find "</head>" S
        ^!InsertText ^p<a name="top"></a>^p
        ^!Close Save
        ^!Goto Loop

        That one will be done to every document opened and when the index
        greater than the count (which will be the last document, the Clip
        will end.

        ^!If ^%Index% > ^%Count% End

        >^!If ^$GetDocCount$ = ^$GetDocIndex$

        That would be used with opened documents and you want to scan
        through them doing some editing using like...

        ^!Document First
        :Loop
        ; edit stuff
        ^!If ^$GetDocCount$ = ^$GetDocIndex$ End
        ^!Document Next
        ^!Goto Loop

        Happy Clip'n!
        Jody

        www.clean-funnies.com, http://www.fookes.us/maillist.htm

        Subscribe: mailto:ntb-Clips-Subscribe@yahoogroups.com
        UnSubscribe: mailto:ntb-Clips-UnSubscribe@yahoogroups.com
        Options: http://groups.yahoo.com/group/ntb-clips
      • Jeff Scism
        This will also be great to use with Farclip. (Could probably have a check box wizard to pick which clip to run from afar.)
        Message 3 of 7 , Jan 1, 2005
          This will also be great to use with Farclip.

          (Could probably have a check box wizard to pick which clip to run from
          afar.)
        • Jody
          Hi Jeff, ... Yes. ... I don t think I would pick a Clip to run from afar, but call the fire department. ;) (You might need to understand
          Message 4 of 7 , Jan 3, 2005
            Hi Jeff,

            >This will also be great to use with Farclip.

            Yes.

            >(Could probably have a check box wizard to pick which clip to run
            >from afar.)

            I don't think I would pick a "Clip to run from afar," but
            call the fire department. <groan> ;) (You might need to understand
            hillbillie/Southern to get it.)

            You would not use a checkbox wizard for that unless you would be
            running more than one Clip and then you would need to put it in
            an array. That you be a difficult thing to do when you would
            normally just run the parent Clip and call a ^!Clip from it. You
            would use the wizard below to pick a Clip to run though forcing a
            choice, but only one choice.

            ^!FarClip ^?{(H=20)Run what Clip==HTML:Color|Back:"Tabs to Spaces"|Back:GetLine|Utilities:"Underline Title"}

            See ya in the funnies!
            Jody

            ...he that is of a merry heart hath a continual feast...
            http://www.clean-funnies.com

            If you haven't laughed at yourself today,
            you missed a good joke! 8?D

            The NoteTabbers Assistant Page
            http://www.notetab.net


            [Non-text portions of this message have been removed]
          • Dave
            Hi Jody I never would have thought of doing that ,A bit bright!! it also works. THANKYOU DAVE in au ... From: Jody To:
            Message 5 of 7 , Jan 5, 2005
              Hi Jody
              I never would have thought of doing that ,A bit bright!! it also works.

              THANKYOU DAVE in au



              ----- Original Message -----
              From: "Jody" <kjv-av1611@...>
              To: <ntb-clips@yahoogroups.com>
              Sent: Tuesday, January 04, 2005 11:13 AM
              Subject: Re: [Clip] running a clip on all files in a directory


              >
              > Hi Jeff,
              >
              >>This will also be great to use with Farclip.
              >
              > Yes.
              >
              >>(Could probably have a check box wizard to pick which clip to run
              >>from afar.)
              >
              > I don't think I would pick a "Clip to run from afar," but
              > call the fire department. <groan> ;) (You might need to understand
              > hillbillie/Southern to get it.)
              >
              > You would not use a checkbox wizard for that unless you would be
              > running more than one Clip and then you would need to put it in
              > an array. That you be a difficult thing to do when you would
              > normally just run the parent Clip and call a ^!Clip from it. You
              > would use the wizard below to pick a Clip to run though forcing a
              > choice, but only one choice.
              >
              > ^!FarClip ^?{(H=20)Run what Clip==HTML:Color|Back:"Tabs to
              > Spaces"|Back:GetLine|Utilities:"Underline Title"}
              >
              > See ya in the funnies!
              > Jody
              >
              > ...he that is of a merry heart hath a continual feast...
              > http://www.clean-funnies.com
              >
              > If you haven't laughed at yourself today,
              > you missed a good joke! 8?D
              >
              > The NoteTabbers Assistant Page
              > http://www.notetab.net
              >
              >
              > [Non-text portions of this message have been removed]
              >
              >
              >
              >
              > Yahoo! Groups Links
              >
              >
              >
              >
              >
              >
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.