So I have created a tool that just mimics the Erase Tool but with a basic license, and the only problem I am running into is when the user selects the output as a shapefile, it messes with my file naming that I do with my processes such as intersect or union. The user is given 3 options to enter, inFc, EraseFc, and Outfc
For example;
ERROR 000732: Selecting Features: Dataset
\PythonDataTest\ERASE_TESTT.shp_Intersect does not exist or is not supported
Failed to execute (SelectLayerByLocation).

As you can see it is trying to append the _Intersect behind the .shp of the output file name the user selected. And this of course wont work later on when my other processes try and find that shapefile.. SO
my question is how do I get the output name + the string im appending to it, to be before .shp and not after it.
Any help is appreciated thank you!