After some discussion with an Esri rep, I know have a solution and answer to WHY this issue is not really a bug (which I agree with). The reason this isn't really a bug is because Input is meant for files that already exist, Output is meant for new files, and I was trying to use the file selector as both either one. Ultimately this is just semantics but makes sense when you think about it.
Now the solution... In my dialog I created 3 input boxes: 1) A Required string type with Direction = Input and Value List = "New", "Append", 2) an Optional file type with Display name = "New", Direction = Output, and 3) an Optional file type with Display Name = "Existing", Direction = Input.
Now, in order to control which input box opens, thereby allowing my to choose either an output (new) or input (existing) file, I needed to put some code into the ToolValidator (Properties->Validation tab). Under the
def initializeParameters(self) category I added the following code to disable the New & Existing file input boxes at startup:
self.params.Enabled = 0 # 0 = Disabled, 1 = Enabled on load
self.params.Enabled = 0 #Disable on load
and under the
def updateParameters(self) category I added the following code to enable the correct file box based upon if I wanted to create a New or Append to existing file:
import sys, string, os
ftype = str(self.params.value)
if ftype == "New":
self.params.Enabled = 1 #
elif ftype == "Append":
self.params.Enabled = 1
Then from within my scripting code, I can just identify which option was selected for the 1st parameter (New or Append), and grab the text string from the appropriate optional file string from parameter 2 or 3 with a simple If/Then statement.
More details on programming the ToolValidator here: