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

Running a Clip on All Files in a Directory

Expand Messages
  • prlproductmanager
    Here is one that I converted from postings on the list. I m using Notetab mainly to process html files. You cna change extensions at will here. Imagine you
    Message 1 of 2 , Jan 3, 2005
    • 0 Attachment
      Here is one that I converted from postings on the list. I'm using
      Notetab mainly to process html files. You cna change extensions at
      will here.
      Imagine you have one clip called "processonefile". This wraps
      around that.


      Process a set of files

      ;First, set some variables to run off of (you may change these)
      ^!SetWizardLabel Choose the Folder containing html files to process
      ^!Set %Dir%=^?{(T=D)&Directory}
      ^!Set %Types%=*.html
      ^!SetArray %FileList%=^$GetFiles("^%Dir%";"^%Types%")$
      ^!Set %Count%=^%FileList0%
      ^!Set %Index%=0; %FileCount%=0

      ;Second, This counts. It processes a file at a time until the
      ;Number of times through the loop=the number of files in the dir
      :CountLoop
      ^!Inc %Index%
      ^!If ^%Index% > ^%Count% CountDone
      ^!Inc %FileCount%
      ^!Goto CountLoop

      ;Open all of the files in the dir
      :CountDone
      ;^!SetDebug ON
      ^!Set %Index%=0
      ^!Open ^%Dir%*.html

      ;for each file, process with clip, save then close
      :Loop
      ^!Inc %Index%
      ^!If ^%Index% > ^%FileCount% COMPLETE
      ^!StatusShow Processing ^%Index% OF ^%Count%
      ^!Clip ProcessONEFile
      ^!save
      ^!Close
      ^!Goto Loop

      ;When done, reopen all of the files for QC
      :COMPLETE
      ^!StatusShow Opening Completed Files
      ^!Open ^%Dir%*.html
      ^!Prompt All Files are ready for QC
    • Jody
      Hi prlproductmanager, NoteTabbers Assistant Library Page http://www.notetab.net/html/library.htm Direct download for DirStuff
      Message 2 of 2 , Jan 3, 2005
      • 0 Attachment
        Hi prlproductmanager,

        NoteTabbers Assistant Library Page
        http://www.notetab.net/html/library.htm
        Direct download for DirStuff
        http://www.notetab.net/zip/dirstuff.zip

        If you download dirstuff.zip and study the Open Directory Clip
        amongst others you can see the wizard at the top to change the
        file types looked for. They are already in the Clip or you can
        type in your own. There are many working examples of Clips to do
        a large amount of various things mostly working with directories.
        In a lot of case, all one has to do is find a Clip that does
        similar to what he/she wants and in the loop where is opens a
        file or does something, edit it to what you want it to do. That
        is basically what I did for Jeff's Clip which is now in the
        Cleanup Website section of DirStuff.

        FWIW, this is the main setting of variables used in a lot of the
        Clips. I store the folder information in an ini file and call it
        from a number of my different Libraries. It basically has preset
        paths that you put in that are stored, nine of them in fact, :)
        but is also has a browse button. That is ignored if a path is
        chosen and visa-versa. Notice the %Type% variable for file types.

        ^!Set %Folder%=^?{(T=D)&Browse: full path, end in backslash=^$GetValue(DirStuff:Browse)$}; %Drop%=^?{&Drop down: full path, end in backslash=_If used, Browse is ignored, may enter path manually^=1|^$GetValue(DirStuff:Path1)$|^$GetValue(DirStuff:Path2)$|^$GetValue(DirStuff:Path3)$|^$GetValue(DirStuff:Path4)$|^$GetValue(DirStuff:Path5)$|^$GetValue(DirStuff:Path6)$|^$GetValue(DirStuff:Path7)$|^$GetValue(DirStuff:Path8)$|^$GetValue(DirStuff:Path9)$}; %Type%=^?{(H=10)File &Types, wildcards OK: *.txt or *.*htm*;*.txt=All Files (*.*)^=*.*|HTML Files (*.*htm*)^=*.*htm*|Text Files (*.txt)^=*.txt|_Html & Text Files (*.*htm*;*.txt)^=*.*htm*;*.txt|Outline Files (*.otl)^=*.otl|Clipbook Files (*.clb)^=*.clb|Initiation Files (*.ini)^=*.ini}; %Sort%=^?{&Sort order=Date|_Name|Size|Type|UnSorted}; %Rev%=^?{&Reverse sort order=Yes^=Rev|_No^=}; %us%=^?{&Check files automatically in file list to open=_Yes^=_|No^=}

        http://www.fookes.us/redir
        http://www.notetab.net

        >Here is one that I converted from postings on the list. I'm
        >using Notetab mainly to process html files. You cna change
        >extensions at will here.
        >
        >;First, set some variables to run off of (you may change these)
        >^!SetWizardLabel Choose the Folder containing html files to process
        >^!Set %Dir%=^?{(T=D)&Directory}
        >^!Set %Types%=*.html
        >^!SetArray %FileList%=^$GetFiles("^%Dir%";"^%Types%")$
        >^!Set %Count%=^%FileList0%
        >^!Set %Index%=0; %FileCount%=0


        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
      Your message has been successfully submitted and would be delivered to recipients shortly.