

Python library to create Siri Shortcuts
source link: https://www.tuicool.com/articles/hit/nq6fU3Z
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

WIP: python-shortcuts
:green_apple: + :snake: = :heart:
python-shortcutsis a library to create Siri Shortcuts on your laptop with your favourite text editor. It uses toml to represent shortcuts.
The library is in a very early development state (PR welcome!), so it does not support all actions from Shortcuts app.
Why
I wanted to convert my shortcut to a file in human-readable format. :)
From the code below this library can create a working shortcut:
[[action]] type = "ask" question = "What is your name?" [[action]] type = "set_variable" name = "name" [[action]] type = "show_result" text = "Hello, {{name}}!"
How to use
Requirements
This library requires plutil
tool, which should be installed on MacOS by default.
On Linux, you should be able to use plistutil
instead.
Installation
pip install python-shortcuts
Usage
shortcut → toml
If you need to convert existing shortcut to a toml file, at first you need to export it. Go into Shortcuts app, open the shortcut and share it. Choose "Share as file" and use this file with this library.
Convert toml
file with shortcut description to a real shortcut file.
After you need to open the file with iOS Shortcuts app.
shortcuts what_is_your_name.shortcut what_is_your_name.toml
toml → shortcut
Also, you can convert shortcut file to a toml
:
shortcuts examples/what_is_your_name.toml what_is_your_name.shortcut
More examples of toml
files you can find here
.
And read the tutorial
! :)
Development
Tests
Run tests:
tox
TODO
- ☐ Conditionals with auto-group_id: if-else, menu
- ☐ Nested fields: dict/array/etc
- ☐ Support variables in every field which support them in Shortcuts app
- ☐ Workflow types: widget, etc.
- ☐ Describe all actions
- ☐ Support magic variables
- ☐ Support all current actions from Shortcuts app
Recommend
-
67
开发者期待的2018 WWDC如期开始,然而今年并没有什么特别大的功能亮点,主要是进行一些bug修复和性能提升,而少之又少的功能里面最让我期待的还是Shortcuts,粗略的了解了下功能就是可以通过自定义一个短语,能过Siri来唤起特定的功能,可以在应用中添加“添加到Siri...
-
56
At WWDC 2018 in San Jose, Apple announced Siri Shortcuts, a long-awaited feature which empowers developers to extend and augment the capabilities of Siri within their own apps. Previously, the SiriKit SDK was quite limite...
-
38
作者:AppCoda, 原文链接 ,原文日期:2018-07-11 译者: Hale ;校对: liberalisman...
-
53
从 SiriKit 到 Siri Shortcuts Apple 在 WWDC 2016 上推出了 SiriKit,使得开发者可以开发 app extension 让用户可以利用 Siri 完成特定的几种任务。这里有两个基本概念: Domain:任务的类型,比如消息、VoIP、...
-
69
If you’ve had an iPhone for any length of time, you’ve likely interacted with Siri. When Siri was first announced in 2011, its ability to understand context and m...
-
15
Siri Shortcuts have been around for a while now, but only with iOS 14 has Apple reall...
-
8
Integrating Emacs with Siri Shortcuts 2021-12-11 15:00 The b...
-
10
siri-shortcuts.el
-
9
Shortcuts for Quick Key Command Formatting with ksc and Siri July 9th 2022 new story4
-
11
ChatGPT Siri
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK