Shortcuty Studio
Shortcuty Studio

Documentation

Learn Shortcuty Script, from your first shortcut to the full language syntax.

Native shortcut UI design patterns

Use these patterns for interfaces built with Apple Shortcuts. Apple controls how the dialogs look; test the layout on the device people will use.

Choose the smallest interface

  • A single answer: Quick capture and review.
  • A changing collection: List picker and empty state.
  • Several repeatable commands: Bounded command launcher.
  • A dense result: Summary and detail drill-down.
  • A few recognizable destinations: Pictured launcher with stable values.

Use verbs for actions (Share report), nouns for destinations (Details), and visible consequences for destructive actions. A Cancel item should do nothing irreversible. Put the requested result before optional extras; don't force a tour through every action. A preview is not a save, and a native cancellation can end the run rather than selecting your Cancel branch.

Quick capture and review

One input, a compact review, then a specific next action. Good for composing a reusable message or drafting a note. Keep validation in source rather than only saying “required” in a prompt.

shortcut:
  entered = input.ask(prompt: "What should the note say?", type: "Text", multiline: true)
  note = trim(entered)
  guard note is not empty else return "Nothing to share."
  result(note)
  menu("Use this note?"):
    case "Share note":
      output.share(input: note)
    case "Cancel":
      exit()

The preview and menu are sequential native dialogs, not one editable form. Nothing is persisted by this example. For a real save, use the verified destination action only in the confirmed branch and announce success after it returns. Do not put an unconditional save after the menu, where it would run after Cancel too.

List picker and empty state

Use a native list chooser for data-driven items instead of generating dozens of menu branches. Show a useful empty state before asking the user to choose. Keep labels unique or retain a verified mapping to stable records; a display title is not a database identifier.

shortcut:
  projects = ["Design review", "Release notes", "Travel checklist"]
  if count(projects) == 0:
    result("No projects yet.")
  else:
    chosen = lists.choose(items: projects, prompt: "Choose a project", multiple: false)
    if let project = chosen:
      result(project)

Replace the literal list with the user's actual source and preserve the chooser's output type. Multiple selection changes the result shape; fetch get_action("lists.choose") before adapting. Cancellation is not guaranteed to yield a fallback item. Avoid silently selecting the first item when nothing was chosen.

Bounded command launcher

Offer a repeatable small command menu when users may want several actions in one run. Use a running flag and explicit budget because native loop-only break is unavailable. A state flag skips later menus; it does not stop native repeat bookkeeping.

shortcut:
  running = true
  repeat 8 times:
    if running == true:
      menu("Workspace"):
        case "Show checklist":
          result("Review inputs\nCheck output\nShare when ready")
        case "Show help":
          result("Choose a task. Done closes this launcher.")
        case "Done":
          running = false
  if running == true:
    result("Session limit reached. Run again to continue.")

Use exit() instead when ending the whole shortcut is intended. On the final iteration do not promise another screen or a loop restart. Do not add an unbounded repeat to mimic a full app; a short one-shot launcher is often clearer.

Summary and detail drill-down

For an audit, calculation or status dashboard, show the useful summary first and make detail optional. Build content once, then let each delivery choice own its own output. This keeps a quiet path quiet and avoids duplicate dialogs.

shortcut:
  completed = 3
  total = 5
  summary = text("Completed: \(completed) of \(total)")
  details = text("\(summary)\nRemaining: \(total - completed)")
  menu(summary):
    case "View details":
      result(details)
    case "Share summary":
      output.share(input: summary)
    case "Done":
      exit()

These values are illustrative, not live status. In a real dashboard distinguish unknown, unavailable and zero instead of inventing a healthy state after an error. Avoid huge text walls in menu titles. Use Quick Look only for a supported preview artifact; HTML preview does not prove JavaScript execution. See recipes for browser delivery when the user actually requests it.

Pictured launcher with stable values

Use a pictured card menu when visual destinations aid scanning. Keep stable dispatch values separate from titles. Normally generate or reuse and attach an appropriate icon for every pictured row; missing images can produce default contact avatars.

See Generate and attach pictured menu icons for the icon workflow. For Today and Reference, choose matching icons and use stable values such as today and reference to decide what each row does.

vcard_menu returns stable Text. Do not invent image paths, URLs or SF Symbol names. Read functions for asset limits and get_action("vcard_menu") for its exact contract. Keep accessible text and native cancellation behavior. Explain a genuine generation failure rather than promising pictures.

For inspected reference shortcuts and what to borrow or avoid, read the separately indexed patterns in Recipes. These original patterns are alternatives, not claims that one reference design fits every task.

Review before delivery

Try an empty result, cancellation, a normal run, and the last iteration. Make sure each choice does only what it says.