Skip to content

DaniruKun/siri-shortcuts.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

siri-shortcuts.el

https://melpa.org/packages/siri-shortcuts-badge.svg https://github.com/DaniruKun/siri-shortcuts.el/actions/workflows/ci.yml/badge.svg https://github.com/DaniruKun/siri-shortcuts.el/actions/workflows/melpazoid.yml/badge.svg

This package allows you to interact with Siri Shortcuts on macOS Monterey and newer. It provides both interactive user commands, as well as public extension APIs.

This opens up a lot of possibilities for Apple ecosystem automation, including but not limited to:

  • Automating HomeKit smart devices
  • Using existing iOS utility Shortcuts
  • Media playback automation
  • Executing other scripts
  • Interacting with the macOS window manager

While a lot of these things could be accomlished with Automator and AppleScript, they are quite old and awkward to use, while Shortcuts offer a simple Scratch-like UI with lots of available automations, as well as a gallery to re-use existing Shortcuts.

Contents

Installation

MELPA

If you installed from MELPA, you’re done. Just run one of the commands below.

M-x package-install RET siri-shortcuts RET

Manual

Then put this file in your load-path, and put this in your init file:

(require 'siri-shortcuts)

Demo

This is a small demo of running a Siri Shortcut than turns on a Yeelight Light Strip and sets it to pink:

shortcuts-demo.gif

Usage

Run one of these commands:

  • siri-shortcuts-run: Run a Siri Shortcut from a list of available Shortcuts.
  • siri-shortcuts-run-async: Same as siri-shortcuts-run, but asynchronous.
  • siri-shortcuts-gallery-open: Open the Shortcuts Gallery.
  • siri-shortcuts-gallery-search: Search the Shortcuts Gallery.
  • siri-shortcuts-open-app: Open the Shortcuts app.
  • siri-shortcuts-edit: Edit an existing Shortcut.
  • siri-shortcuts-create: Create a new Shortcut.

Tips

  • You can use the full Shortcuts scheme URL API by using the function siri-shortcuts-browse-url.

    For example:

    (siri-shortcuts-browse-url "open-shortcut" "MyShortcut")
        

    Or use the high-level functions directly in your code:

    (siri-shortcuts-run "SampleShortcut")
        

Development

Bug reports, feature requests, suggestions — oh my!

License

GPLv3

About

A set of Emacs commands and functions for interacting with Siri Shortcuts.

Topics

Resources

License

Stars

Watchers

Forks