require('uxp').shell
To get an instance: require("uxp").shell<br/> These APIs require UXP Manifest v5 configurations. see Launch Process
openPath(path, developerText)
Opens the given file or folder path in the system default application.<br/> NOTE: UWP can access only files in the UWP App sandbox. See File access permissions in UWP
Returns: Promise<string> - Promise that resolves with "" if succeeded or String containing the error message if failed.
Param
Type
Description
path
stringString representing the path to open
developerText
stringInformation from the plugin developer to be displayed on the user consent dialog. Message should be localized in current host UI locale.
Example
// for MacOS
shell.openPath("/Users/[username]/Downloads");
shell.openPath("/Users/[username]/sample.txt");
// for Windows
shell.openPath("C:\Users\[username]\Downloads");
shell.openPath("C:\Users\[username]\AppData\Local\...\sample.txt");
openExternal(url, developerText)
Opens the url in the dedicated system applications for the scheme.<br/> NOTE: file scheme is not allowed for openExternal. Use openPath for those cases.
Returns: Promise<string> - Promise that resolves with "" if succeeded or String containing the error message if failed.
Param
Type
Description
url
stringString representing the URL to open
developerText
stringInformation from the plugin developer to be displayed on the user consent dialog. Message should be localized in current host UI locale.
Example
shell.openExternal("https://www.adobe.com/");
shell.openExternal("https://www.adobe.com/", "develop message for the user consent dialog");
Example
shell.openExternal("maps://?address=345+Park+Ave+San+Jose"); // for MacOS
shell.openExternal("bingmaps:?q=345+Park+Ave+San+Jose, +95110"); // for Windows