I'm trying to make sure there is no '-' in the output filename, and if there is, to set an error (circle with the red 'X') so that the tool can't be run, and have a tooltip that explains the issue. I've tried a bunch of things, but from what I've read, it seems this should work:
if parameters[7].value:
if parameters[7].value.value.count("-") > 0:
parameters[7].setErrorMessage("Output cannot have a '-'." + \
"Please change the dash and rename the output after the tool has run")
else:
parameters[7].clearMessage()
return
I'm not super clear on what is returned from the list of parameters. The paramater type is "DEShapefile". There is no error message being thrown when I use "--" as the filename.
Can someone see why it's not working for me?