See the strip_filename function in the help.
Also, in help -> contents -> macro functions by category -> string functions - see sub_str, pos.
Another useful function - maybe_quote_filename.
Also, if you haven't seen it, in the installation docs folder there is SlickCMacroBestPractices.pdf.
Graeme
Edit - sub_str should have the underscore removed. For some reason, the forum software doesn't accept a post that has s u b s t r (no underscore) in it.