Event(イベント)コンテキスト

An Event Context allows specification of an event which is needed to activate its profile e.g. SMS received, screen has gone off.

Events are a little different to other contexts because they are instantaneous whereas other contexts usually have a duration.

This means that it is nonsensical to specify that e.g. the screen brightness should be set to X for the duration of the event, so Tasker assumes that all settings actions should persist beyond the event.

For more information about specifying events, see the Event Edit screen.

https://tasker.joaoapps.com/userguide/en/eventcontext.html

イベントコンテキストでは、例えば「SMSを受信した」とか「端末の画面がOFFになった」などの状態の変化を示すイベントを成立条件として指定します。

イベントコンテキストは他のコンテキストが一定の期間成立状態を保つのに対し、その成立が瞬間的であるという点で少し異なります。

これはつまり、例えば画面の明るさをコンテキストの成立中だけある値に変更すると言うような指定が意味を持たないと言うことです。したがってTaskerはイベントコンテキストを契機に設定アクションを実行した場合、イベント終了後もその変更状態を維持します。

イベントコンテキストの設定に関して詳しくはイベント編集画面をご覧下さい。

Event Parameters(イベントパラメーター)

When a task is triggered by an event, the parameters of the event that ocurred are passed to the task so that it can make decisions based on the event details.

The parameters are passed in the array %evtprm.

The order of elements of the array have values which match the order of the parameters of the event.

Example: if an event’s second parameter is an Application, %evtprm2 in the launched task will be set to the label of the application which triggered the event.

https://tasker.joaoapps.com/userguide/en/eventcontext.html

イベントコンテキストが成立してタスクが実行されるとイベントに関するパラメーターがタスクに渡されるのでタスク内でイベントの詳細情報を利用することが出来ます。

その際、パラメーター群は配列変数%evtprmに格納されて渡されます。

配列の要素の順序はイベントコンテキストのパラメーターの順序に一致します。

例:イベントコンテキストの2番目のパラメーターが「アプリケーション」の場合、実行されたタスクの%evtprm2変数にはイベントコンテキストの成立契機となったアプリケーションのラベルが格納されます。