TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Any way to program Siri Shortcuts in iOS 12 besides drag-and-drop?

14 点作者 yangl1996超过 6 年前
The Shortcuts app in iOS 12 seems really powerful, comparable to a minimal weakly-typed scripting language. So I&#x27;m wondering whether there is an AppleScript-like way to program it, instead of dragging and dropping those blocks.<p>If not, will anyone be interested in some sort of tool that converts source code (in, say, a subset of Python or Bash) to Shortcuts program?

4 条评论

theli0nheart超过 6 年前
I just did some sleuthing and it looks like you can create a shortcut using XML. :)<p>You can reverse engineer the format by creating an iCloud link to a shortcut. There&#x27;s a JSON payload that that the shortcut permalink page requests. That payload contains a link to a binary plist which can be translated into XML (`plistutil -i shortcut.plist`).<p>Here&#x27;s one I just generated that expands shortened URLs: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;dlo&#x2F;1217af3b86f363faf578aa23408c19ef" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;dlo&#x2F;1217af3b86f363faf578aa23408c19ef</a><p>After you write your shortcut, encode it in binary plist format (using plistutil), and then upload that blob to a URL. Use the following scheme to import it into Shortcuts.app:<p><pre><code> workflow:&#x2F;&#x2F;import-workflow&#x2F;?name=URL20%Expander&amp;url=encodedUrl </code></pre> Hope this helps!
评论 #18029147 未加载
oboroten超过 6 年前
I just started working on this library, maybe it can be helpful :)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;alexander-akhmetov&#x2F;python-shortcuts" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;alexander-akhmetov&#x2F;python-shortcuts</a>
npace12超过 6 年前
Scriptable by Simon B. Støvring <a href="https:&#x2F;&#x2F;itunes.apple.com&#x2F;us&#x2F;app&#x2F;scriptable&#x2F;id1405459188?mt" rel="nofollow">https:&#x2F;&#x2F;itunes.apple.com&#x2F;us&#x2F;app&#x2F;scriptable&#x2F;id1405459188?mt</a>
评论 #18029172 未加载
earenndil超过 6 年前
It looks like if you buy pythonista ($10!) you can execute python scripts.
评论 #18029163 未加载