How Can I Insert the Simple File Name Into a Document?
Moderators: AmigoJack, bbadmin, helios, MudGuard
How Can I Insert the Simple File Name Into a Document?
In text pad, I see a command that allows the user to easily insert the fully qualified filename into a document. Is there a command for inserting just the simple file name into the current document. I need to do this for file headers, but see no easy way to do this.
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
- talleyrand
- Posts: 624
- Joined: Mon Jul 21, 2003 6:56 pm
- Location: Kansas City, MO, USA
- Contact:
As an uglier hack, you can create a DOS batch script, c:\header.bat
Contents would be
Set that as a tool
tool parameters of $FileName $File
Usage would be create new file, run tool. If TP doesn't prompt you that the file has changed, give focus to a different document and when focus returns to original, then TP will figure out the file changed.
This only appends the data to an existing file so if there's 1000 lines, it will add to the bottom. A more clever batch script would rename the existing file, dump the one line from TP into correct file, append the existing content to correct file and purge the renamed file. I'm too lazy to have tested that but the point was the tool parameters might be something you can work with.
Contents would be
Code: Select all
echo %1 >> %2tool parameters of $FileName $File
Usage would be create new file, run tool. If TP doesn't prompt you that the file has changed, give focus to a different document and when focus returns to original, then TP will figure out the file changed.
This only appends the data to an existing file so if there's 1000 lines, it will add to the bottom. A more clever batch script would rename the existing file, dump the one line from TP into correct file, append the existing content to correct file and purge the renamed file. I'm too lazy to have tested that but the point was the tool parameters might be something you can work with.
I choose to fight with a sack of angry cats.