首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >提供从Siri语音输入到scriptable或pythonista脚本的参数?

提供从Siri语音输入到scriptable或pythonista脚本的参数?
EN

Stack Overflow用户
提问于 2020-04-17 23:23:01
回答 1查看 485关注 0票数 0

苹果是否允许像scriptable (javascript)或pythonista (python)这样的第三方应用程序接受通过Siri语音命令提供的参数,如果允许,我们如何在可脚本(javascript)脚本中访问这些参数?如果没有,有没有什么办法可以让人写一个可脚本化的脚本,然后让它(以某种方式)接受一些语音输入?

到目前为止我所知道的

Scriptable提供了一个来自'share sheet‘的args示例,尽管它不完全清楚是否可以通过Siri语音接收一个类似的args变量

代码语言:javascript
复制
// Run from a share sheet to see which
// arguments are shared. Arguments are
// passed to a script when it is run
// from a share sheet.
// Configure the types of arguments
// a script supports from the script
// setttings. This script accepts all
// types of arguments and shows an alert
// with a summary of what ia being shared.
// This is useful to examine which
// values an app shares using the 
// share sheet.
let summary = args.plainTexts.length
  + " texts\n"
  + args.images.length
  + " images\n"
  + args.urls.length
  + " URLs\n"
  + args.fileURLs.length
  + " file URLs"
let alert = new Alert()
alert.title = "Shared"
alert.message = summary
alert.addCancelAction("OK")
await alert.presentAlert()
EN

回答 1

Stack Overflow用户

发布于 2020-06-26 06:58:18

不是的。Scriptable使用快捷方式来处理Siri语音命令,但不支持参数。

一种解决方法是在启动可编写脚本的脚本之前编辑快捷方式以开始听写,并将听写的结果传递给运行脚本块。

Here's a link到imgur相册,带有关于如何设置上述内容的屏幕截图。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61275124

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档