Lattika Download
Chapters
  1. Help index
  2. Getting started
  3. Snapping windows with the mouse
  4. Layouts
  5. The layout editor
  6. Keyboard shortcuts
  7. Window memory
  8. Rules for apps
  9. Workspaces
  10. The Shortcuts app and automation
  11. iCloud sync
  12. Trial, buying and licenses
  13. Troubleshooting
  14. Frequently asked questions

Chapter 9 of 13

The Shortcuts app and automation

Lattika offers actions to the Shortcuts app. Use them in your own shortcuts, run them from Spotlight, or trigger them with the Shortcuts menu bar item. Lattika must be running for any of them to work.

Actions

Snap Front Window to Zone
Moves the frontmost window into a zone of its display's layout. Parameter: the zone number, 1 to 20. Fails if the layout has no such zone. Example: a shortcut named Browser left with one action, Snap the front window to zone 1, run from Spotlight when a browser window is in front.

Apply Layout
Switches a display to a layout. Parameters: the layout, chosen from your list, and optionally a display. Without a display, every display switches. The zones flash. Example: Focus mode applies the Reading Column layout to every display; Meeting applies Halves to the external display only.

Restore Workspace
Puts every window of a saved workspace back. Parameter: the workspace. Returns the number of windows moved, which a later action can use. Example: a shortcut that runs Restore Workspace: Morning and then shows a notification with the returned number.

Save Workspace
Records the current windows under a name. If a workspace with that name exists, it is updated. Parameter: the name. Example: Save desk with the name Docked, run before you unplug your monitors.

Restore Windows to Zones
Puts every remembered window back into its zone (chapter 6). No parameters. Example: an automation that runs it when a Focus mode turns off.

Apply Placement Rules
Runs the per-app rules over every open window (chapter 7). No parameters. Example: run it at login, a few seconds after your apps have opened.

Show Zones
Flashes the zones of every display. No parameters. Example: a shortcut bound to a key in the Shortcuts app for people who prefer that over ⌃⌥Z.

The last three are also offered to Spotlight and Siri with the phrases "Show Lattika zones", "Restore Lattika windows" and "Apply Lattika rules".

URL commands

For scripts and the Open URLs action in Shortcuts, Lattika answers these URLs. In Terminal, run open "lattika://show-zones".

URLWhat it does
lattika://snap?zone=2Snap the focused window into zone 2 (numbers start at 1)
lattika://snap?zone=2&bundle=com.apple.TextEditSnap that app's front window instead
lattika://show-zonesFlash the zones
lattika://restoreRestore remembered windows to their zones
lattika://apply-rulesApply the rules to every open window
lattika://workspace?name=DockedRestore the workspace with that name
lattika://editorOpen the layout editor; add ?new=1 to open the New Layout sheet
lattika://settingsOpen Settings; add ?pane=zones, shortcuts, rules, workspaces, excludedApps, sync or license for a pane
lattika://onboardingOpen the welcome window

Spaces in a workspace name must be written as %20.

If it does not work

  • The actions do not appear in Shortcuts. Open Lattika once; macOS registers an app's actions when it runs. If they are still missing, restart the Shortcuts app.
  • An action says "Lattika is not running". Start Lattika. Actions cannot start it for you.
  • "Layout not found" or "Workspace not found". The layout or workspace was deleted or renamed after the shortcut was built. Pick it again in the action.
  • Snap Front Window does nothing. The front window belongs to an excluded app, is not a standard window, or the zone number is higher than the layout has. Also check the Accessibility permission and the trial.
  • A URL does nothing. Check the spelling of the host part, for example show-zones with a hyphen. Zone numbers start at 1, not 0.