Re: Opening notebooks with NotebookOpen when one of the directory
- To: mathgroup at smc.vnet.net
- Subject: [mg86266] Re: Opening notebooks with NotebookOpen when one of the directory
- From: ragfield <ragfield at gmail.com>
- Date: Fri, 7 Mar 2008 02:28:17 -0500 (EST)
- References: <fqo8sn$t1q$1@smc.vnet.net>
On Mar 6, 2:09=A0am, deepyog... at gmail.com wrote: > I am using Mathematica 6.0.2 on Mac OS X -- anyone have any idea why I > can't have an alias as an element in the directory path when using the > NotebookOpen command? For example, if I have a notebook file called > xyz.nb and it is physically in a folder called /Documents/Realfolder > and there is also an alias called /Documents/Realfolderalias that > points to /Documents/Realfolder, then why does the following fail: > > docpath2 = ToFileName[{"/Documents"}, "Realfolderalias"]; > nb77 = NotebookOpen[ToFileName[docpath2, "xyz.nb"], > =A0 =A0WindowMargins -> {{-1671, Automatic}, {Automatic, -16}}, WindowSize= > -> {949, 509}] > > but this works fine: > > docpath2 = ToFileName[{"/Documents"}, "Realfolder"]; > nb78 = NotebookOpen[ToFileName[docpath2, "xyz.nb"], > =A0 =A0WindowMargins -> {{-1671, Automatic}, {Automatic, -16}}, WindowSize= > -> {949, 509}] > > In other words why doesn't Mathematica open the desired file if one of > the directory path elements in the complete filepath description > happens to be an alias?? I did a some Googling of this and also > searched this group but didn't come across anything. Any suggestions > on how to make something like this work? I thought that aliases under > Mac OS X make everything work the same as the real thing? The aliases > were created using the Finder "Make Alias" command if it matters. Mathematica does not support aliases as part of a file path. An alias is actually a regular file that contains special data that the Finder knows how to interpret. If you want this to work you should use a symbolic link (created with "ln -s" in the terminal). This creates an actual link in the file system, rather than a special file that the Finder treats differently. -Rob