Edit in GitHubLog an issue

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.

ParamTypeDescription
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
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> - Promise that resolves with "" if succeeded or String containing the error message if failed.

ParamTypeDescription
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 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
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.