0

Does apple yet allow third party apps, like scriptable (javascript) or pythonista (python) to accept arguments provided via Siri voice commands, and if so, how can we access such arguments in a scriptable (javascript) script? If not, is there any work around such that someone can write a scriptable script and have it (somehow) accept some voice input?

What I know so far

Scriptable provides an example of args from a 'share sheet' although it's not entirely clear if it's possible to receive an a similar args variable via Siri voice

// 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()
stevec
  • 41,291
  • 27
  • 223
  • 311

1 Answers1

1

No. Scriptable uses Shortcuts to handle Siri voice commands, which has no support for parameters.

One workaround could be to edit your shortcut to begin dictation before launching your Scriptable script, and passing the results of the dictation to the run script block.


Here's a link to an imgur album with screenshots on how to set up what is described above.

kalkronline
  • 459
  • 2
  • 12
  • Can you show (minimally) the steps necessary to implement? If so, I'll try and report back – stevec Jul 02 '20 at 00:10
  • @steve Check out my edit, I took some screenshots for you. Should be the same for both Pythonista and Scriptable. – kalkronline Jul 02 '20 at 01:47