Maksim, You should change the following line:
On Apr 17, 4:20 am, Maksim <[email protected]> wrote: > > set thePrefix to text 1 thru ((offset of "." in doc_name) - 1) of > doc_name to something like this: set thePrefix to text 1 thru ((length of doc_name) - (offset of "." in (reverse of characters of doc_name) as string)) of doc_name The code you currently have will find the FIRST "." in the name of the document, which means that you'll get unwanted results if the user includes a dot earlier in the name, in addition to immediately before the fil extension. The code I posted above will take care of those situations, as well as the basic case. Daniel A. Shockley
