Edit in GitHubLog an issue

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.

ParamTypeDescription
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 clipboard
1// for MacOS
2shell.openPath("/Users/[username]/Downloads");
3shell.openPath("/Users/[username]/sample.txt");
4
5// for Windows
6shell.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.

ParamTypeDescription
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 clipboard
1shell.openExternal("https://www.adobe.com/");
2shell.openExternal("https://www.adobe.com/", "develop message for the user consent dialog");

Example

Copied to your clipboard
1shell.openExternal("maps://?address=345+Park+Ave+San+Jose"); // for MacOS
2shell.openExternal("bingmaps:?q=345+Park+Ave+San+Jose, +95110"); // for Windows
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2023 Adobe. All rights reserved.