require('uxp').shell
To get an instance: require("uxp").shell
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.
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 | string | String representing the path to open |
developerText | string | Information from the plugin developer to be displayed on the user consent dialog. Message should be localized in current host UI locale. |
Example
Copied to your clipboard// for MacOSshell.openPath("/Users/[username]/Downloads");shell.openPath("/Users/[username]/sample.txt");// for Windowsshell.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.
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 | string | String representing the URL to open |
developerText | string | Information from the plugin developer to be displayed on the user consent dialog. Message should be localized in current host UI locale. |
Example
Copied to your clipboardshell.openExternal("https://www.adobe.com/");shell.openExternal("https://www.adobe.com/", "develop message for the user consent dialog");
Example
Copied to your clipboardshell.openExternal("maps://?address=345+Park+Ave+San+Jose"); // for MacOSshell.openExternal("bingmaps:?q=345+Park+Ave+San+Jose, +95110"); // for Windows