Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Name of m-file currently being edited (not run)
Date: Mon, 19 Oct 2009 18:09:02 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 24
Message-ID: <hbi9vu$e8j$1@fred.mathworks.com>
References: <a07292bf-2896-4c96-9127-5af7788c524f@g19g2000yqo.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1255975742 14611 172.30.248.37 (19 Oct 2009 18:09:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 19 Oct 2009 18:09:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:578481


ImageAnalyst <imageanalyst@mailinator.com> wrote in message <a07292bf-2896-4c96-9127-5af7788c524f@g19g2000yqo.googlegroups.com>...
> Does anyone know how to detect what the filename of the m-file that
> currently has focus in the editor?  (It's not mfilename - that's only
> the name of the currently RUNNING file.)  What I would like to do is
> to have a shortcut button on my toolbar that changes to the folder
> containing this m-file when I click on that shortcut button.  I think
> this would be easier than to find the folder in the history drop down
> list of 20 different Current Folders, and way easier than having to
> browse to the folder via the "..." button.  I could be wrong, but I
> bet it's not a standard thing and it will probably have to be a Yair
> Altman undocumented hack (http://undocumentedmatlab.com/#)
> 
> Currently, if I have 10 different m-files open in the editor and I
> click on one, then I need to do the extra step of changing the current
> folder to the folder containing that file.  I'd like to simplify that
> step.

Of course: http://undocumentedmatlab.com/blog/accessing-the-matlab-editor/

You might also consider assigning a keyboard shortcut to this action, using my EditorMacro utility: http://undocumentedmatlab.com/?s=EditorMacro

Yair Altman
http://UndocumentedMatlab.com