open Action

An action to open files or urls in macOS.

{
  "open": {
    "type": "file",
    "src": [
      "~/Desktop/dinner-plans.txt",
      "~/Desktop/favourite-cheeses.txt"
    ]
  }
}

Properties

type
ENUM
Required

The type to be opened.

Value Description
"file" Treat the src as a file path.
"url" Treat the src as a URL.
src
STRING | ARRAY

The src of the item(s) to open, e.g. a file path or URL string

Examples

Open a webpage

{
  "type": "button",
  "text": "Open Alfred's homepage",
  "events": [
    {
      "triggers": "actioned",
      "action": {
        "type": "json",
        "src": {
          "open": {
            "type": "url",
            "src": "https://www.alfredapp.com"
          }
        }
      }
    }
  ]
}