browsefile
Choose one existing file without opening or changing it. See File and folder pickers for variable lifetime, cancellation, and supported hosts.
Syntax
browsefile -variable Name [-title "Title"] [-directory "Starting folder"] [-filter "Description|pattern"] [-global]
Parameters
| Parameter | Alias | Required | Description |
|---|---|---|---|
-variable |
-var |
Yes | Result name; read ${local.Name}, or ${global.Name} with -global. |
-title |
No | Dialog title; supports placeholders. | |
-directory |
-d |
No | Existing starting folder; supports placeholders and relative paths. |
-filter |
No | File type description/pattern pairs separated by a pipe. Default: all files. | |
-global |
No | Store in the current session instead of the current script. Required for command-box use. |
Example
browsefile -variable SelectedFile -title "Choose a drawing" -filter "SOLIDWORKS drawings|*.slddrw|All files|*.*"
msgbox -value "Selected: ${local.SelectedFile}"
Cancel clears the result and stops the script without a command error. Unattended tasks and MCP cannot open this dialog. For folder selection use browsefolder.