# Why autocompletion of file name is not working in notebookdirectory?

I use windows system and Mathematica 10

The default working directory is c:\\user\\name\\document

If I type Import["xx , Mathematica show a list to let me select matched directory or file under document. Effect like this

Now I change working directory to NotebookDirectory by

SetDirectory[NotebookDirectory[]]


However, Import["xx still matches files and directory original document, doesn't show any file in the NotebookDirectory[], what is wrong?

Update

according to MarcoB and george2079, there is an option called NotebookBrowseDirectory, whenever one opened a file via file menu, it changes to that directory.

However the problem is, this option is not relevant to the drop down list effect I want. It only affect the directory open by this file browser button.

However, the auto filename match is still point to c:\\user\\name\\document. Is it a bug? It doesn't conform to the good looking wolfram document.

It appears that the File Browser interface ignores the current directory set by SetDirectory; instead, it always uses the last directory from which it was opened, at least on my system (MMA 10.4 Win7-64).

This seems to be controlled by a NotebookBrowseDirectory which is partially documented as "a global option that determines the current working directory". You can check out its value using the Options Inspector, under General.

Note that attempting to change the value of the NotebookBrowseDirectory from the Options Inspector crashed my Mathematica, so handle with care!

• Hi, MarcoB. I don't understand your answer. I changed NotebookBrowseDirectory, however it doesn't change anything Mar 26, 2016 at 7:12
• @matheorem to be honest, I don't understand the inner workings of the front end either... I think you made a good point about the option only affecting the FileBrowser behavior, but I haven't tested it yet. Mar 26, 2016 at 11:27

I think its left to the OS which seems to take you to the last directory where you opended a file ( via file menu, etc )

If you are doing lots of this here is a little trick, evaluate this:

 fopen := SystemDialogInput["FileOpen", Directory[]]


Now when you need an inline file name :

 Import[fopen];


Now highlight the "fopen" and shift-control-enter (evaluate in place) to pop up a file open dialog in the working directory. Whatever file you select gets pasted in as a string.

• Hi, george2079. I updated my post. Have a look: ) Mar 26, 2016 at 7:37