system.file.openFile default location not working

i am using the system.file.openfile function and i have a default file location setup.

path = system.file.openFile(’’,’\mdkfs01.mdk.cosma.com\Modatek\Inter Department’)
if path != None:
event.source.parent.getComponent(‘Btn1 Link’).text = path

but it dosn’t seem to matter what you put as a default location because the browser always opens to documents.

is there something that i am missing?

If the default location is not valid it opens to Documents. Is your path correct?

yes that was the problem.

it doesn’t like the file server name. it wanted to see it as a drive

therefore it needed to be ‘M:\Inter Department’

What’s the trick to pass a “null” to the optional extension argument of this function? I just want to direct the user to the directory, but would like the filetype to be “All Files”. Ran out of guesses. Closest i came was using \ but it just passes the path to the extension argument. Thought I was clever with [.], but no wax.

NM, Tried None and voila. Thanks anyway…still learning python.

3 Likes