require('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>
- A promise that resolves with "" if succeeded or a string containing the error message if failed.
Param | Type | Description |
---|---|---|
path | String | |
developerText | String | Information from the plugin developer to be displayed on the user consent dialog. Message should be localised in current host UI locale. |
Example
Copied to your clipboard1// for MacOS2shell.openPath("/Users/[username]/Downloads");3shell.openPath("/Users/[username]/sample.txt");45// for Windows6shell.openPath("C:\Users\[username]\Downloads");7shell.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>
- A promise that resolves with "" if succeeded or a string containing the error message if failed.
Param | Type | Description |
---|---|---|
url | String | |
developerText | String | Information from the plugin developer to be dispayed on the user consent dialog. Message should be localised in current host UI locale. |
Example
Copied to your clipboard1shell.openExternal("https://www.adobe.com/");2shell.openExternal("https://www.adobe.com/", "develop message for the user consent dialog");
Example
Copied to your clipboard1shell.openExternal("maps://?address=345+Park+Ave+San+Jose"); // for MacOS2shell.openExternal("bingmaps:?q=345+Park+Ave+San+Jose, +95110"); // for Windows