Run PDMShell Scripts from Dispatch
Use Dispatch's Shell Command action to start a standalone PDMShell script. For scripts that should run inside PDM menus, events or tasks, consider the PDMShell add-in. Edit either type of script in standalone PDMShell.
Configure the shell command
- Leave Verb empty.
- Set Filename to the full path of your installed
pdmcli.exe, found through the PDMShell shortcut. Enter the path in this field without surrounding quotes. - Set Parameters to the following, replacing the script path and selected-file variable for your Dispatch action:
runscript -source "C:\Scripts\Inspect.pdmshell" -filePath "%PathToSelectedFile%"
%PathToSelectedFile% is the Dispatch value in this example; it must resolve to the selected file's complete path before PDMShell receives it. -source selects the script, and -filePath supplies its target. The script must be readable on the executing computer, and PDMShell must connect to the vault.
Write the script
Inside Inspect.pdmshell, use PDMShell's own placeholders:
fileinfo -filePath "$localPath"
quit -silent
Each command that acts on the selected file needs its target argument. See RUNSCRIPT placeholders for file names, PDM variables and other available values.
Wait for the result
Configure the calling automation to wait for the started program to terminate when it needs the result. End the script with quit -silent; without reaching that command, the application can remain open.
The standalone process returns 0 for success or 1 if a command/script failed or was canceled. Later successful commands do not clear earlier failures. Do not use -single when waiting for a script result: it forwards commands to another window without waiting for that window's execution.
Supply additional values
Use supported RUNSCRIPT parameters to select files. For file-specific values, read the file's PDM variables, such as $(Description.@). RUNSCRIPT does not define arbitrary positional parameters for extra Dispatch values.
Use the add-in's event placeholders when the automation needs transition information. An external runscript call does not automatically receive the PDM event context.