19372Re: build clip to save file renamed as highlighted text reordered
- Jul 1, 2009Okay, 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
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 I. Last, Suffix(Jr/Sr/II/III/etc.)
For now I'll work on the first of those, but thought should be given to
> 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).
> ^!Set %Folder%=^%Drop%
> ^!Toolbar Copy
> ^!SetListDelimiter " "
> ^!SetArray %full_name%=^$GetSelection$
> ^!Set %indexed_name%="^%full_name^%full_name0%%"
> ^!Set %name_counter%=1
> ^!If ^%name_counter% = ^%full_name0% NameDone
> ^!Set %indexed_name%="^%indexed_name%-^%full_name^%name_counter%%"
> ^!Inc %name_counter%
> ^!Goto CreateName
> ;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
- << Previous post in topic Next post in topic >>