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

19372Re: build clip to save file renamed as highlighted text reordered

Expand Messages
  • Don - HtmlFixIt.com
    Jul 1, 2009
      Okay, first let's start a different thread if you don't mind.

      Let's start by simpling this down and then building it back up, is that
      reasonable?

      How about this:
      1. start with the file already open that we want to work on
      2. highlight the name
      3. save the file if doesn't exist already (are we renaming a file?)
      4. give an alert if file already exists

      Is that a good starting point?

      Also what possible parameters are there for the name?
      First I. Last
      First Last
      First Last-LastMore
      First I. Last, Suffix(Jr/Sr/II/III/etc.)

      For now I'll work on the first of those, but thought should be given to
      other variations.

      Don

      Jeff wrote:
      > OK here it is again.
      >
      > The original concept is to highlight a name ("Jeffery G. Scism") in a
      > document, have the Clip change it to "scism-jeffery-g.htm" on the
      > clipboard, so I can autosave the document using that as the file name. I
      > don't want to change the name ON te source document, but only the name
      > it is saved as. I want it to error out if the Doc already exists. I
      > don't want to overwrite existing files. If a file already exists I need
      > to merge the new entry, probably manually.
      >
      > I had clips that did the name swap in my old computer, but they ere
      > lost in a HD Crash.
      >
      > I searched the Clips list archive and found some of the previous
      > discussion but with what I am starting with I am getting "syntax
      > errors" probably due to the improved Reg-ex now in use. It was
      > originally written for NoteTab Std 4.95.
      >
      > Here is the broken clip I have been working on- it goes NOWHERE. (I
      > just can't grasp the concepts apparently).
      >
      >
      > __CLIP__
      >
      > :PARSE_NAME
      >
      > ^!Set %Folder%=^%Drop%
      > ^!Toolbar Copy
      > ^!SetListDelimiter " "
      > ^!SetArray %full_name%=^$GetSelection$
      > ^!Set %indexed_name%="^%full_name^%full_name0%%"
      > ^!Set %name_counter%=1
      >
      > :CreateName
      > ^!If ^%name_counter% = ^%full_name0% NameDone
      > ^!Set %indexed_name%="^%indexed_name%-^%full_name^%name_counter%%"
      > ^!Inc %name_counter%
      > ^!Goto CreateName
      >
      > :NameDone
      > ;strip periods
      > ^!Set %indexed_name%=^$StrReplace(".";"";"^%indexed_name%";0;0)
      >
      > ^!Set %indexed_name%=^$StrLower("^%indexed_name%")$
      > ;(Syntax error this line)
      > ^!Set %indexed_name%=^$FileName$.htm
      >
      > __/CLIP__/
      > /
    • Show all 25 messages in this topic