Effacer les filtres
Effacer les filtres

How can I create a list of .m files currently open in the editor?

11 vues (au cours des 30 derniers jours)
John Anderson
John Anderson le 27 Fév 2014
Commenté : John Anderson le 27 Fév 2014
Is there a way to create a list of .m files currently open in the editor? I frequently jump between several projects. It would be very handy to remember which .m files I had open when working in a particular directory so that I can automatically re-open them when I resume work on that project. That way, I can easily pick up from where I left off. I am thinking of creating a script for this purpose. I do not want to simply open every .m file in the current directory. Also, I might have .m files open from my own toolbox.
  2 commentaires
Image Analyst
Image Analyst le 27 Fév 2014
Do you mean currently showing in the Current Folder panel, rather than "currently open in the editor"? Because there is no need to reopen files if they're already open.
dpb
dpb le 27 Fév 2014
Modifié(e) : dpb le 27 Fév 2014
IIR(ead)C think he's thinking of saving the resulting list while working on a given project then using it at a later time to restore the same list when coming back.
Towards a more general project-oriented workspace environment some of the other language IDEs have.
As an aside, while TMW has done much in many areas regarding the ability of the editor to diagnose code in m-files, overall as a programming editor it's kinda' weak.

Connectez-vous pour commenter.

Réponse acceptée

Jacob Halbrooks
Jacob Halbrooks le 27 Fév 2014
The MATLAB Editor API should handle this. Try:
>> openFiles = matlab.desktop.editor.getAll;
>> fileNames = {openFiles.Filename};

Plus de réponses (0)

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by