Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
get active file in editor

Subject: get active file in editor

From: Andy Greenwood

Date: 15 Sep, 2010 22:56:05

Message: 1 of 4

I recently upgraded to matlab 2010. In 2009, I had a shortcut to check out the active file in the editor from my versioning software. this shortcut determined the active file (to be checked out) in the editor by calling:

edhandle = com.mathworks.mlservices.MLEditorServices;
cur_file = char(edhandle.builtinGetActiveDocument);

Since updating, the 'builtinGetActiveDocument' method is no longer available from the returned handle. In fact, none of the builtin methods come up in the list from an edhandle. [tab complete]. I am assuming they have been encapsulated in a different level but I haven't been able to find them yet. Is there an equivalent operation in ML2010 or does anyone know where I can find the 'builtinGetActiveDocument' method?? thanks

&D

Subject: get active file in editor

From: Andy Greenwood

Date: 27 Sep, 2010 20:00:21

Message: 2 of 4

"Andy Greenwood" <aeg165@ccrma.stanford.edu> wrote in message <i6riu5$o5h$1@fred.mathworks.com>...
> I recently upgraded to matlab 2010. In 2009, I had a shortcut to check out the active file in the editor from my versioning software. this shortcut determined the active file (to be checked out) in the editor by calling:
>
> edhandle = com.mathworks.mlservices.MLEditorServices;
> cur_file = char(edhandle.builtinGetActiveDocument);
>
> Since updating, the 'builtinGetActiveDocument' method is no longer available from the returned handle. In fact, none of the builtin methods come up in the list from an edhandle. [tab complete]. I am assuming they have been encapsulated in a different level but I haven't been able to find them yet. Is there an equivalent operation in ML2010 or does anyone know where I can find the 'builtinGetActiveDocument' method?? thanks
>
> &D

Hey, it's me again. I still haven't fixed this so I figured that maybe if I posted again it would make this post relevant again.

Where did this command go? The inner Java workings aren't really documented anywhere as far as I can tell so I pretty much need the inside scoop. anybody? (i'm looking at you matlab development team)

&D

Subject: get active file in editor

From: Yair Altman

Date: 28 Sep, 2010 08:22:08

Message: 3 of 4

"Andy Greenwood" <aeg165@ccrma.stanford.edu> wrote in message <i7qt4l$g9e$1@fred.mathworks.com>...
> "Andy Greenwood" <aeg165@ccrma.stanford.edu> wrote in message <i6riu5$o5h$1@fred.mathworks.com>...
> > I recently upgraded to matlab 2010. In 2009, I had a shortcut to check out the active file in the editor from my versioning software. this shortcut determined the active file (to be checked out) in the editor by calling:
> >
> > edhandle = com.mathworks.mlservices.MLEditorServices;
> > cur_file = char(edhandle.builtinGetActiveDocument);
> >
> > Since updating, the 'builtinGetActiveDocument' method is no longer available from the returned handle. In fact, none of the builtin methods come up in the list from an edhandle. [tab complete]. I am assuming they have been encapsulated in a different level but I haven't been able to find them yet. Is there an equivalent operation in ML2010 or does anyone know where I can find the 'builtinGetActiveDocument' method?? thanks
> >
> > &D
>
> Hey, it's me again. I still haven't fixed this so I figured that maybe if I posted again it would make this post relevant again.
>
> Where did this command go? The inner Java workings aren't really documented anywhere as far as I can tell so I pretty much need the inside scoop. anybody? (i'm looking at you matlab development team)
>
> &D


In R2010 use: edhandle = com.mathworks.mlservices.MLEditorServices.getEditorApplication
The supported methods interface has also changed somewhat (for example, builtinGetActiveDocument => getActiveEditor)
MLEditorServices is an internal Java class that will probably *never* be documented. MathWorks uses it internally and needs the freedom to modify it at will between releases, as you have seen that they actually did in 2010.

As an alternative, you can also use Matlab's internal editorservices object, that is somewhat more documented - http://blogs.mathworks.com/desktop/2009/10/26/the-matlab-editor-at-your-fingertips/

Yair Altman
http://UndocumentedMatlab.com

Subject: get active file in editor

From: San

Date: 14 Nov, 2011 11:09:11

Message: 4 of 4

This should be what you are looking for :
 http://blogs.mathworks.com/desktop/2011/05/09/r2011a-matlab-editor-api/

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us