打开 URL
动词:openUrl
使用系统缺省 Web 浏览器或指定的 Web 浏览器打开指定的 URL,然后返回打开 URL 的浏览器的进程标识。
语法
openUrl --url(String) [--useCustomBrowser(Boolean)] --customBrowser(String) (Numeric)=value
输入
| 脚本 | 设计器 | 必需的 | AcceptedTypes | Description |
|---|---|---|---|---|
| -- URL | URL | 必需的 | 文本 | 命令打开的 URL(Web 站点地址)。可以使用 Web 浏览器打开的任意 URL:因特网 URL、内部网等。 |
| --useCustomBrowser | 使用定制浏览器 | 可选 | BOOLEAN | 启用后,将允许使用定制 Web 浏览器。 |
| --customBrowser | 定制浏览器 | 仅当“使用定制浏览器”为 True 时 | 文本 | 定制 Web 浏览器可执行文件的路径。 |
输出
| 脚本 | 设计器 | AcceptedTypes | Description |
|---|---|---|---|
| 值 | 进程标识 | 成员 | 带有给定 URL 的浏览器启动进程标识。此数字标识在操作系统上执行的进程(使用 URL 打开的浏览器)。 |
示例
示例 1:使用该命令用缺省浏览器打开在 URL 参数中输入的 URL。
defVar --name processID --type Numeric
openUrl --url "https://www.ibm.com" processID=value
logMessage --message "${processID}" --type "Info"
// The above example displays the page entered in the browser and displays the process ID number for that browser:
// [Example]: 83384.
示例 2:使用该命令从定制浏览器通过指定 URL 来打开站点。
defVar --name processID --type Numeric
defVar --name browserPath --type String
selectFile --title "Select the path to the desired custom browser's executable" --filter "*exe" browserPath=value
// Opening URL, selecting a custom browser, accessing the folder and file where it is installed.
openUrl --url "https://www.ibm.com" --useCustomBrowser --customBrowser "${browserPath}" processID=value
logMessage --message "${processID}" --type "Info"
// The above example displays the page entered in the specified browser and displays the process ID number of that browser:
// [Example]: 61672.