Milan,
My problem was a semicolon instead of a comma in the call to
tcl("tk_getOpenFile", args). The function now seems to work. I can work up
versions for GetSaveFile and ChooseDirectory. Once they seem to work, what
is the process for suggesting they be included in the Tk package?
function GetOpenFile2(; filetypes::Array=[], initialdir::String="",
initialfile::String="", multiple=false, title::String
="")
args = Dict()
if length(filetypes) > 0 args["filetypes"] = filetypes end
if length(initialdir) > 0 args["initialdir"] = initialdir end
if length(initialfile) > 0 args["initialfile"] = initialfile end
args["multiple"] = multiple
if length(title) > 0 args["title"] = title end
tcl("tk_getOpenFile", args)
end
In [46]:
GetOpenFile2(filetypes=["{Text files} {.txt}","{CSV files} {.csv}"],
title="Select File",initialdir="/Users/ericshain/Documents/")
Out[46]:
"/Users/ericshain/Documents/MATLAB/Test
Data/CMV/11910_FP_PCR_3192010135222_MC.csv"