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

Re: [Clip] automatic naming of files

Expand Messages
  • rpdooling
    Dear hrs: That last clip is a keeper. Thanks rpd ... may be ... for ... new ... SourceFile
    Message 1 of 11 , Oct 17, 2005
    • 0 Attachment
      Dear hrs:

      That last clip is a keeper. Thanks

      rpd

      --- In ntb-clips@yahoogroups.com, hsavage <hsavage@p...> wrote:
      >
      > hsavage wrote:
      > > Jefry S wrote:
      > >> hsavage wrote:
      > >>>
      > >> Thanks, but i'm still having problems. I'm using this clip-
      > >
      > > Any clue as to how to prompt for input to choose location?
      > >
      > > Thanks again, this is fun!
      > >
      > > ------------------
      > > H="Save As First Line"
      > > ;_Modified-Updated~Created
      > > ;_20051011_5:15:18p_hsavage@p...
      > > ^!ClearVariables
      > > ; edit next line to reflect your starting_folder' preference
      > > ^!Set %path%=^?{(T=D)Choose Path To Save Files=C:\+r2rweb\lists\}
      > > ;
      > > ^!SetListDelimiter ;
      > > ; these are the 9 forbidden characters I know about, \/:*?"<>|
      > > ^!SetArray %frbdn%="\;/;:;*;?;";<;>;|"
      > > ^!Set %idx%=0; %cnt%=^%frbdn0%
      > > ^!Set %name%="^$GetLine(1)$"
      > > :FRBDN
      > > ^!Inc %idx%
      > > ; replaces forbidden characters with dashes
      > > ^!Set %name%=^$StrReplace("^%frbdn^%idx%%";"-";"^%name%";0;0)$
      > > ^!If ^%idx% = ^%cnt% NEXT ELSE FRBDN
      > > ^!Set %name%=^$StrTrim("^%name%")$
      > > ;
      > > ^!KeyBoard F2 &50 #^%name%.#
      > > ;^!RenameDoc "^%name%"
      > > ^!Save AS "^%path%^%name%."
      > > -------------------------
      >
      > Jefry,
      >
      > The clip above was my second completed attempt, it is the one you
      may be
      > using now. I have a new, modified version I'm going to paste below.
      > It's my favorite so far. I like it well enough that I added an icon
      for
      > it in 2 of my Personal Toolbars.
      >
      > The clip runs, grabs line 1, scans it for forbidden characters replacing
      > them with dashes. You can edit that line to use a character other than
      > dashes if you wish.
      >
      > Edit, if you wish, the ^$StrReplace( line, replace the dash with an
      > ascii character of your choosing.
      >
      > This is different from previous clips in that it uses only ONE Wizard
      > which allows 3 inputs,
      >
      > input 1. an entry point to edit the proposed filename.
      >
      > input 2. select default save location or use the wizard to select a
      new
      > location.
      >
      > input 3. allow choice of whether to retain or delete source file.
      > Default is to retain, not delete, source.
      >
      > ----------------------------
      > H="Save As First Line"
      > ;_Modified-Updated~Created
      > ;_20051013_2:07:17p_hsavage@p...
      > ^!ClearVariables
      > ^!Set %sourcefile%="^$GetExpandedName(^##)$"
      > ^!SetListDelimiter ;
      > ;
      > ; these are the 9 forbidden characters I know about, \/:*?"<>|
      > ^!SetArray %frbdn%="\;/;:;*;?;";<;>;|"
      > ^!Set %idx%=0; %cnt%=^%frbdn0%
      > ^!Set %name%="^$GetLine(1)$"
      > :FRBDN
      > ^!Inc %idx%
      > ; replaces forbidden characters with dashes
      > ^!Set %name%=^$StrReplace("^%frbdn^%idx%%";"-";"^%name%";0;0)$
      > ^!If ^%idx% = ^%cnt% NEXT ELSE FRBDN
      > ^!Set %name%=^$StrTrim("^%name%")$
      > ; edit next line to reflect your starting_folder' preference
      > ;
      > ^!SetWizardLabel "Choose Destination - Edit FileName - Delete
      SourceFile"
      > ;
      > ; this is a very long line, you should check to make sure it is
      > straightened out
      > ^!Set %name%=^?{New FileName to Accept or Edit=^%name%};
      > %path%=^?{(T=D)Choose Destination Path For File=C:\+r2rweb\lists\};
      > %delsource%=^?{Delete Source_File==Yes^=1|_No^=0}
      > ;
      > ^!Save AS "^%path%^%name%"
      > ^!IfTrue ^%delsource% ^!DeleteFile ^%sourcefile%
      > ---------------------------------------
      >
      > Long lines usually get wrapped in email and it's up to you to make a
      > single long line out of them again. I've separated the most likely to
      > be wrapped with blank lines.
      >
      > Try this clip, I think you'll like it better than the last.
      >
      > ºvº
      > 05.10.13
      > hrs > hsavage@p...
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.