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

Re: [Clip] File Name Clip and Loop Macro

Expand Messages
  • Jody
    Hi Rayellen, ... I have a number of Clips that work with directories in my DirStuff. You ll find some that you can modify to do what you want. Look for ones
    Message 1 of 2 , Jun 28, 2004
    • 0 Attachment
      Hi Rayellen,

      >1- I've got a nice clip that reformats, saves and closes a file,
      >but I've got 6000 files to do this to (all in 1 directory). Can
      >someone give me the clip syntax for a loop that would run the
      >macro sequentially on every single file in the dir?

      I have a number of Clips that work with directories in my
      DirStuff. You'll find some that you can modify to do what you
      want. Look for ones that use ^$GetFiles instead of the ones with
      the older method using ^$GetFileFirst/^$GetFileNext although those
      still have good use for some purposes. Try right clicking over the
      Library combobox and choose "Open as Document" and then do a Find
      for ^$GetFiles. They'll use ^!SetArray.

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

      >2- When it saves the files, it needs to save it with a name that has
      >no spaces or forbidden characters. I've got a variable I'd like to
      >paste as the title of the doc, and also use as the file name, but
      >when I paste it as the file name, I want to remove spaces.
      >I tried:
      >^!SaveAscii As "^$GetDocumentPath$^%Drug%.htm"
      >But that doesn't work.
      >Imagine that the value in the variable %Drug% is something like
      >"8-HOUR BAYER", so my heading will be <h3>8-HOUR BAYER</h3> (which
      >currently works fine), but my doc title should be "8-HOURBAYER.htm"

      ^!Set %Drug%=^$StrReplace(" ";"";"^%Drug%";0;0)$
      ^!Save As "^$GetDocumentPath$^%Drug%.htm"

      You can test with this:
      ^!Set %Drug%=^$StrReplace(" ";"";"^$GetSelection$";0;0)$
      ^!Info ^%Drug%

      For the "forbidden characters" you would need to run the ^$StrReplace
      once for each character. Something like:

      ^!Set %Drug%=^$StrReplace("^";"";"^%Drug%";0;0)$
      ^!Set %Drug%=^$StrReplace("|";"";"^%Drug%";0;0)$
      ^!Set %Drug%=^$StrReplace("?";"";"^%Drug%";0;0)$
      ^!Set %Drug%=^$StrReplace("*";"";"^%Drug%";0;0)$

      ^$StrReplace("Substr";"Replacestr";"Str";Casesensitive;Wholeword)$

      Example: ^$StrReplace("o";"?";"NoteTab Pro";True;False)$
      Result: N?teTab Pr?

      The last two fields can be 0|1, No|Yes, or False|True
      That is so for any of the true/false fields in functions.

      Affiliate links for Fookes Software, thanks! :)
      Fookes Software Home http://www.fookes.com/regnow.html?2448&item=home
      NoteTab Home http://www.fookes.com/regnow.html?2448&item=notetab
      Buy Fookes Software Now! http://www.fookes.com/regnow.html?2448

      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.