Scripting API リファレンス|TropoスクリプティングAPI

value オブジェクト

   

event.valueaskrecordと共に利用されます。 askと一緒に使う場合は「choice」に戻り、 recordと一緒に使う場合は再生するための音声の録音に戻ります(event.recordURIと互換可能です)。 下記の例でaskと一緒に使う用法を示しています。choiceが実行された場合 (affirmative、negativeいずれの場合においても)、 括弧の外側のvalueに戻ります。

 

サンプル

 
  var event = ask("Do you want to make an appointment? Say yes or no", {
   choices:"affirmative(yes, yeah, one), negative(no, nah, two)"
});
say("You said " + event.value);
log("They said " + event.value);

event = ask "Do you want to make an appointment? Say yes or no", {
   :choices => "affirmative(yes, yeah, one), negative(no, nah, two)"}
say "You said " + event.value
log "They said " + event.value
<?php

$event = ask("Do you want to make an appointment? Say yes or no", array(
   "choices" => "affirmative(yes, yeah, one), negative(no, nah, two)"
));
say("You said" . $event->value);
_log("They said " . $event->value);

?>
event = ask("Do you want to make an appointment? Say yes or no", {
   "choices":"affirmative(yes, yeah, one), negative(no, nah, two)"})
say("You said " + event.value)
log("They said " + event.value)
event = ask("Do you want to make an appointment? Say yes or no", [
   choices: "affirmative(yes, yeah, one), negative(no, nah, two)"])
say("You said $event.value")
log("They said $event.value")