opendialog Action
An action to show a macOS Open dialog to select a file.
{
"opendialog": {
"filetypes": "public.image",
"folder": "~/Desktop",
"prompt": "Open",
"message": "Choose an Image",
"setvariable": "picked_image",
"action": { ... }
}
}
Properties
- setvariable
- STRING
The name of the variable to place the selected file(s) into. The value of this variable will be an array if multiselect is set to true or a string otherwise.
Examples
Open a dialog to select and open images
{
"type": "button",
"text": "Pick images",
"events": [
{
"triggers": "actioned",
"action": {
"type": "json",
"src": {
"opendialog": {
"filetypes": "public.image",
"multiselect": true,
"folder": "~/Desktop",
"prompt": "Open",
"message": "Choose one or more images",
"setvariable": "picked_images",
"action": {
"type": "json",
"src": {
"open": {
"type": "file",
"src": "{var:picked_images}"
}
}
}
}
}
}
}
]
}