View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Shortcut tools

4.8 | 4 ratings Rate this file 8 Downloads (last 30 days) File Size: 17.1 KB File ID: #27567 Version: 1.4

Shortcut tools


Richie Cotton (view profile)


11 May 2010 (Updated )

Programmatically manipulate shortcuts.

| Watch this File

File Information

A set of utilities to programmatically manipulate shortcuts (including toolbar shortcuts and help browser favourites).

AddShortcut adds a shortcut to the specified group, which by default is the toolbar, e.g.

AddShortcut('Tidy', 'close all hidden; clear all; clc;');

RemoveShortcuts removes shortcuts from the
 specified group, which by default is the toolbar, e.g.

RemoveShortcuts([], 'How to Add');

GetShortcuts retrieves the details of existing toolbar shortcuts, and GetShortcutCategories retrieves the categories that those shortcuts are stored in.

CopyShortcuts moves shortcuts between categories.

AddBrowserFavourite adds a favourite page/command to your help browser favourites list.

Note that the functions rely on undocumented MATLAB features which are subject to change. The files all work correctly in R2010a, R2009b, R2009a and R2008b, (but note that the icon file given in the example does not exist in R2008b). Previous versions have not been tested.

MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
07 Oct 2015 Andreas

Very useful for R2012 version of MatLab. However, does not work for R2015. Has somebody an idea how to get it to work reliably for R2015?

17 Oct 2013 Ori Adam

very useful. Just the toolbox I was looking for.

Comment only
15 Aug 2012 Adam Filion

Adam Filion (view profile)

05 Jul 2012 Shlomi Buganim

22 Feb 2012 Jonas

Jonas (view profile)

Excellent set of tools! Thank you very much.

31 Jan 2011 Jesse Hopkins

Jesse Hopkins (view profile)

There is definitely a need for this. Thanks for this submission and the helpful documentation. I was working on similar functionality a while back, and stumbled on the "editShortcut" method of ShortcutUtils, which is nice because it will create a shortcut if it doesn't exist, otherwise will modify the existing shortcut. This way you don't need to blow away the shortcuts everytime. Here's the syntax I've used:
awtinvoke(com.mathworks.mlwidgets.shortcuts.ShortcutUtils,'editShortcut',name,'Toolbar Shortcuts',name,'Toolbar Shortcuts',evalstr,iconfile,'true')

Comment only
12 May 2010 1.1

Now checks JVM is turned on.
Logical values now accepted for editable command to AddToolboxShortcut.

19 Aug 2010 1.2

Added new functions: AddBrowserFavourite, GetToolbarShortcuts, ShortcutsFile, GetShortcutCategories

Cleaned up terminology: group is now referred to as category throughout.

23 Aug 2010 1.3

Cleaned code, added new functions, added more help documentation.

01 Oct 2010 1.4

'backend' folder renamed 'private'
Add Category replaced with AddCategories
Minor bug fixes

Contact us