Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question was posted 2 days ago at community. I had a good answer but it does not quit do what I wanted. Hence I am trying here to see if someone might know of some other solution. Here is the question:

I tend to name some files, which are in different folders, with the same name. Say source.nb

But when going back to open a specific file from one folder, using File->Open dialog, it does not show the full path of the file. Even a right-click on the file name, or hovering the mouse over the name, has no pop-up menu to show the full path name. This makes it hard to know in which folder any of these files are in. So I end up opening the wrong file many times. Here is a screen shot:

Mathematica graphics

I looked at options and did not see a way to change this. It might be there and I have overlooked it. I searched for "file" options. Using V 9.01 on windows.

Would any one know of a way to make it either display the full path name, or at least when hovering the mouse over the name, it will display the full path name in a small pop-up help display (which is the common way most applications handle this sort of thing).

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

This works on my system (v7, Windows 7):

Cases[
  NotebooksMenu /. Options[$FrontEnd],
  FrontEnd`FileName[{_, path__}, name_, ___] :> FileNameJoin @ {path, name},
  {3}
]

The first _ in {_, path__} is to skip $RootDirectory; if you want to preserve $RootDirectory leave it out.

To create a palette with buttons to open these Notebooks you may use:

Cases[
  NotebooksMenu /. Options[$FrontEnd],
  FrontEnd`FileName[{_, path__}, name_, ___] :> FileNameJoin@{path, name},
  {3}
] // CreatePalette @ Column[Button[#, NotebookOpen@#] & /@ #] &;
share|improve this answer
    
Thanks. But how do I use the output of the above? THe above just gives me a list of the file names with fullpath/ But what is next? I need to open a notebook. I am not familar with notebook commands. I just use the File->Open to open files. –  Nasser Jan 4 at 2:35
    
@Nasser Sorry, I didn't realize that was part of the question. Basically you can use NotebookOpen but I guess you want something more automated like a palette? –  Mr.Wizard Jan 4 at 2:38
    
I see. So you mean I'd copy the file name from the Cases output, and paste into a NotebokOpen command? Ok. Will try that. Sure, a palette based method would be great and much easier to use, if possible. It would be useful for many others I assume. I hope this feature is added to V 10. But no problem if it is too much trouble. I'll try the copy/paste method for now. thanks. –  Nasser Jan 4 at 2:40
    
@Nasser I added a palette generating function. Please try it and let me know if this is what you need. –  Mr.Wizard Jan 4 at 2:54
    
Nice. I tried it. Yes, much easier that way. Will use this from now on. I have many files with same name that I open all the time, and this helps allot. thanks. –  Nasser Jan 4 at 3:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.