I am using arcpy 10.0, python and arctoolbox. I have a question regarding the parameters for the arc toolbox. In my script I have a function that does a check on an input file. The user is charged with selecting the appropriate input file. Say, if they select a shapefile instead of a text file, they get an error. A box pops up saying they chose the wrong input file. At that point, the script just stops and the input parameters box has alos gone away. Is there a way to make the input parameters box appear again on erroneous user input? So instead of running the program again on the users error, the input parameters box automatically reappears so the user can enter in a correct input file. Any knowledge on the subject would be greatly appreciated. Thanks.
You could just set up your input parameter definitions appropriately (on your script tool's Properties->Parameters tab set the Data Type of the desired parameter to 'Shapefile' if that is what you want them to be able to input) and let the geoprocessing framework handle the validation for you.
Based on your previous question it sounds like you are attempting to use a custom dialog box to perform validation messaging. This is exactly what Customizing Script Tool Behavior and the