Working on multiple projects?
This function allows you to save the current editor files for easy access in the future by addition of a shortcut toolbar, multiple sessions can be saved for returning to at any point in the future.
Notes: Tested on 2006a to 20011b and R2013b (assumptions made on other versions).
On post R2012b - if you change the icon its not remembered when you add new sessions.
Tested on both Windows and LINUX (not on MAC)
SaveCurrentEditorFiles ( 'project A' ); % This will store all the open files associated with "project A" for future access.
Other projects can be added.
To retrieve, click on the "Saved Editor Sessions" on the shortcuts tool bar and enter the integer associated with the project (integer and project description written to the command window)
Thank you. All fixed now. No, it's not new in any way. (I may have blundered earlier when I tried to update a project name.) I have about nearly 10 projects and subprojects, and I find this script so useful and time-saving.
Matlab should have this as a builtin.
Something must have gone wrong with one of the indexes saved or you have none saved locally (is this a new computer?) - the data are saved in the shortcuts.xml in the prefdir.
To completely reset - delete the matlab shortcut. You can remove items by providing a 2nd argument at runtime which is true -> i.e. SaveCurrentEditorFiles ( refName, 1 );
When I hit the SavedEditorSessions icon I get the error "Reference to non-existent field 'name'. " even with nothing in the Workspace.
How can I reset or at least get back to a blank state? I tried deleting and reloading the file but the error is still there.
Thanks, Daniel and Robert. In the code, I added '2012b' immediately after the 2 instances of '2011b' and it works nicely in V 2012b, now.
@Warwick - excellent thats good to know.
Regarding R2012X you would need to update two switch statements (the editor interface has changed in both 2010 and 11 and I have no visibility to 2012...) one at the top and one near the bottom of the file. I will update later.
@Warwick, have a look at the code and the switch statement at the beginning. Simply try to extend the cases to R2012b.
This is a very useful addition for me as I usually have a few different ongoing projects.
It works fine on Mac version of R2011b. However, on the (beta) R2012a (Mac) it doesn't work and returns "version not supported".
Update to work on R2013b (assumtion made on other versions R2012b onwards)
Addition of R2012a and R2012b (assumption that interface doesn't change from 2011a/b)
Inspired: Editor Session Manager