Hello script writers!
I have written a script with some general functions working with the full name of a file for the usage in other scripts:
GetFileExt ........... get file extension from full name of a file.
GetFileName ....... get file name without extension from full name of a file.
GetFilePath ......... get file path from full name of a file.
GetNameOfFile ... get file name with extension from full name of a file.
For all functions either the index number of an opened document or the full name of a file can be specified as an input parameter. The functions can be even used without any parameter to get the appropriate part of the full file name of the active document. The functions use only core string and UltraEdit functions. So nothing of the environment (running mode, find parameters, ...) is changed by these functions.
The script file contains also a few examples at bottom of the file. So the script file can be also simply executed to see the functions in action.
If you want to report mistakes or have suggestions for further enhancements or other useful file name functions post a message here.
The script file FileNameFunctions.js
with the code can be viewed or downloaded from the scripts section of the Extra Downloads