As a follow on to madpentiste's code, I attempted to add the following two lines after line 37 (leaving the rest of the code unchanged):

Code:
w. tk .call('set', '::tk::dialog::file::showHiddenBtn', '1')
w. tk .call('set', '::tk::dialog::file::showHiddenVar', '0')
and got the error:

parent namespace doesn't exist

This code has worked in this context before. I'm sure this is a stupid error...