mw.desktop.fileBrowsers.contextMenu Extension Point
You can add items to the Files panel context menu using the
mw.desktop.fileBrowsers.contextMenu extension point.

To add items to the Files panel context menu:
Create a JSON-formatted file named
extensions.jsonand place it in a folder namedresources.Add a set of JSON declarations to
extensions.jsonthat defines one or more context menu items. Define custom sections in a"sections"array within the extension point. Define custom menu items in an"items"array within the"sections"array.Add the folder containing the
resourcesfolder with theextensions.jsonfile to the MATLAB® path. To add the folder to the path, use theaddpathfunction or right-click the folder in the Files panel and select Add to Path > Selected Folders and Subfolders.
This JSON code shows the basic structure of the
mw.desktop.fileBrowsers.contextMenu extension point.
{
"mw.desktop.fileBrowsers.contextMenu": {
"sections": [
{
"name": "myToolbox.myCustomSection",
"type": "SimpleMenuSection",
"items": [
{
"name": "myToolbox.myItem1",
"type": "SimpleMenuItem",
"when": "selection.isEmpty",
"action": {
"name": "myToolbox.myItem1Action",
"type": "Action",
"text": "Item 1",
"icon": "icons/myMenuItemIcon.svg",
"callback": "displayFileAttributes"
}
}
]
}
]
}
}For more information about using extension points, see Extend MATLAB Using Extension Points.
Properties
More About
Version History
Introduced in R2025a
