Macro - Get File Name Stripped Down in Drawing File

Hello all,

My goal is to take a drawing file name and split it into two fields (the first 18 characters in the "number" custom property, the rest will be in a "description" field.

I have a working macro, but it adds the sheet title at the end of the "description" field.  Any ideas how to remove it?

Or is there a way of using the \$PRP:"SW-File Name" to get a "clean" file name for me to use?

Thanks in advance,

Nick

SolidworksApi macros